タグ

threadに関するgfxのブックマーク (30)

  • Rubyでforkを利用したマルチプロセスでコアを使い切りたい気持ち - Qiita


    Rubyfork(2)pipe(2)使 TL;DR? Forking and IPCinRuby, Part I Forking and IPCinRuby, Part II Unix  RubyUnix -  Thread?  GIL RubyGVL(Giant VM lock)   RubyVM Giant VM lock (GVL) 
    Rubyでforkを利用したマルチプロセスでコアを使い切りたい気持ち - Qiita
  • Concurrency Utilitiesの「再」まとめ - Java8対応版 - argius note


     Concurrency Utilities使 (2013-12-26) Concurrency UtilitiesJavaConcurrency Utilities     (Executor)        Concurrency UtilitiesAPI java.util.con
    Concurrency Utilitiesの「再」まとめ - Java8対応版 - argius note
  • Pthreads by juj · Pull Request #3266 · emscripten-core/emscripten

    This set of commits implements initial pthreads library support for Emscripten code, and allows native code to utilize multithreading with the pthreads API. This backs on experimental research on the JavaScript SharedArrayBuffer and Atomics APIs from https://docs.google.com/document/d/1NDGA_gZJ7M7w1Bh8S0AoDyEqwDdRh4uSoTPSNn77PFk/edit?usp=sharing , and as such is preliminary and unsupported in othe

    Pthreads by juj · Pull Request #3266 · emscripten-core/emscripten
  • もう怖くないCocoaの並列処理(GCD & NSOperation/NSOperationQueue) - $ cat /var/log/shin


    CocoaGCDNSOperation/NSOperationQueue Cocoa - $ cat /var/log/shin  OS CocoaGCDNSOperation/NSOperationQueue使
    もう怖くないCocoaの並列処理(GCD & NSOperation/NSOperationQueue) - $ cat /var/log/shin
    gfx
    gfx 2014/08/16
  • 失敗ロック例いくつか - 兼雑記


     :  //  pthread_mutex_t g_mu = PTHREAD_MUTEX_INITIALIZER; // 使 g_mu  class C {public: C() { pthread_mutex_init(&mu_, NULL); } void doSlowOperation() { pthread_mutex_lock(&mu_); /
    失敗ロック例いくつか - 兼雑記
    gfx
    gfx 2014/06/06
  • Goroutine Synchronization : D-7 <altijd in beweging>


    go 1.2.x deferdefergoroutine TL;DR; gogoroutine defer goLL
    Goroutine Synchronization : D-7 <altijd in beweging>
    gfx
    gfx 2014/05/28
  • スレッドセーフという幻想と現実 - yohhoyの日記(別館)

    この記事はC++ Advent Calendar 2013の15日目にエントリしています。 内容はC++標準ライブラリとスレッドセーフに関する解説になります。 flickr / rennasverden もくじ What's スレッドセーフ? スレッドセーフという幻想 基型とデータ競合 C++標準ライブラリとデータ競合 C++標準ライブラリ:シーケンスコンテナ編 C++標準ライブラリ:連想コンテナ編 スレッドセーフ RELOADED 基的なスレッドセーフ保証 std::shared_ptr<T> std::rand() std::cout (文のみ約9000字) はじめに マルチスレッド対応の点では他言語に遅れを取っていたプログラミング言語C++ですが、C++11ではようやく標準ライブラリにスレッドサポートが追加されました。C++11スレッドサポートではスレッドクラスstd::thr

    スレッドセーフという幻想と現実 - yohhoyの日記(別館)
  • Python の subprocess の preexec_fn の実装と fork のスレッドセーフティー問題

    methane @methane @riywo fork してから exec する前に実行して欲しい関数を指定します。具体的には os.setsid とか指定します。(最近の Python だと start_new_session キーワード引数指定できますが) 2013-03-24 02:11:06

    Python の subprocess の preexec_fn の実装と fork のスレッドセーフティー問題
  • Objective-Cでスレッドをデッドロックさせずに非同期処理の終了を待つ方法。


    Objective-C  NSLog(@"start."); dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ for (int i = 0; i < 5; i++) { sleep(1); NSLog(@"Process: %d", i); dispatch_sync(dispatch_get_main_queue(), ^{NSLog(@"Main Process"); }
    Objective-Cでスレッドをデッドロックさせずに非同期処理の終了を待つ方法。
  • C++11時代のthreading - fjnlの生存記録のような何か


      C++11 Advent Calendar 2011 : ATND 6 std::thread C++11thread std::thread  #include std::thread #include <iostream> #include <thread> void f() { std::cout << "f()" << std::endl; } int main() { std::thread thr(f); thr.join(); return 0; }  f()  $ g++ -o thr thr.cpp -std=c++0x $ ./thr f() $ 
    C++11時代のthreading - fjnlの生存記録のような何か
    gfx
    gfx 2012/11/23
  • try-and-back-off アルゴリズム - melpon日記 - HaskellもC++もまともに扱えないへたれのページ


    C++11 Lockable std::lock  template<class L1, class L2, class... L3> void lock(L1& m1, L2& m2, L3&... m3);  使try-and-back-off   try-and-back-off      
    try-and-back-off アルゴリズム - melpon日記 - HaskellもC++もまともに扱えないへたれのページ
  • GCDを試してみる : As Sloth As Possible


    RubyBlocksBlocksNSArraymapGrand Central Dispatch(GCD) GCD  APIqueue調 Ruby  # ruby f =
    GCDを試してみる : As Sloth As Possible
    gfx
    gfx 2012/09/05
  • JavaScriptによるマルチスレッドの実現‐Concurrent.Threadの裏側

    function f ( ) { do_something(); do_another(); do_one_more(); } このプログラムでは順番に3つの関数を呼び出していますが、各関数呼び出しの間でいったんスレッドの実行権を他のJavaScriptコードに渡したいとします。これは次のように、各関数呼び出しをそれぞれ別の関数に分けて、間にsetTimeoutを挿むようにプログラムを書き換えることで実現できます。 function f ( ) { do_something(); setTimeout(f1, 1);  // 1ミリ秒後にf1を呼び出す } function f1 ( ) { do_another(); setTimeout(f2, 1); } function f2 ( ) { do_one_more(); } こうして書き換えた関数fを、 f(); f(); のようにし

    JavaScriptによるマルチスレッドの実現‐Concurrent.Threadの裏側
    gfx
    gfx 2012/07/10
    FunctionをtoString()してソースコードを得て、それを解析してCPS変換してeval()で再構築か。
  • GNU/Linuxにおけるプロセス


    GNU/Linux Windows Linux Kernel APIfork(), clone(), vfork()Linux kernelsys_fork(), sys_clone(), sys_vfork()do_fork()使
  • Node v0.7.0の新機能Isolates(マルチスレッド)を試す - y-kawazの日記

    たまたま新環境にNode.js入れてたらv0.7.0がリリースされてたのに気がついたので、勢いで新機能を試してみた。 V8のバージョンが上がったとかもあるけど多分一番の目玉はIsolates(マルチスレッド)のサポートかな、と思う。開発ブランチでは他にもDomainsという機能も実装中らしいと聞いてたがそれはまだv0.7.0では使えないようだ。 Isolatesの使い方がドキュメントの方には載ってなかったのでソースをisolateとかthreadとかで探してみたところ、どうやらchild_processモジュールのspawnやforkのオプションに thread:true を渡してやればマルチスレッドを使ってくれるっぽいことが分かった。 シングルスレッドと非同期I/Oでシンプル&ハイパフォーマンスが売りのNodeだが、よく「マルチコアが使い切れない、重たいCPU処理したら固まるじゃんプギャ

    Node v0.7.0の新機能Isolates(マルチスレッド)を試す - y-kawazの日記
  • http://atnd.org/events/24032

    http://atnd.org/events/24032
    gfx
    gfx 2012/01/07
    行くかどうか分からないけどとりあえず参加した。
  • 冬のLock-Free祭り

    Please select the category that most closely reflects your concern about the presentation, so that we can review it and determine whether it violates our Terms of Use or isn't appropriate for all viewers.

  • スレッドとプロセス

    スレッドとプロセス 題: スケジューリング 田浦健次朗 スレッドとは?  制御の流れ(thread of control): CPUを抽象 化したもの • OSに「スレッドを作りたい」と要求 • OSはスレッドにCPUを割り当て,実行 • スレッドは「たくさんあってよい」 • OSが交互に実行 • CPUが複数あれば各CPU上で プロセスとは?  プログラムの起動  プロセス の生成  論理アドレス空間の生成 +mainスレッドの生成  プロセス=アドレス空間+(1つ 以上の)スレッド 実践的知識  システム内のプロセス・スレッドの観察 • Windows : タスクマネージャ, perfmon • Linux : ps, top スレッド・プロセス関係API  共通な主要概念 • 生成,終了 • 同期,実行の制御  代表的スレッドAPI名 • Unix: POSIX

    gfx
    gfx 2011/11/30
  • Should volatile acquire atomicity and thread visibility semantics?

    Should volatile Acquire Atomicity and Thread Visibility Semantics? Traditionally, the semantics of C's and C++'s volatile keyword have been unclear. In particular, these languages state that operations are "evaluated strictly according to the rules of the abstract machine" (C99, 6.7.3-6) But, at least in the pthread context, this has generally not been interpreted to apply to inter-thread visibili

  • Dart言語のIsolateについて調べてみた | へびにっき


    GoogleDartIsolate調   dartlang.orgDartboard DartIsolateErlang使receive class IsolateA extends Isolate {main() { port.receive((msg, replyTo)