随笔分类 -  Multi-Thread

摘要:http://www.parallellabs.com/2010/01/31/pthreads-programming-spin-lock-vs-mutex-performance-analysis/POSIX threads(简称Pthreads)是在多核平台上进行并行编程的一套常用的API。线程同步(Thread Synchronization)是并行编程中非常重要的通讯手段,其中最典型的应... 阅读全文
posted @ 2010-10-25 23:25 史莱姆 阅读(678) 评论(0) 推荐(0)
摘要:On Mac OS X and Windows there are builtin CompareAndSwap functions you should be using anyway (InterlockedCompareExchange() and OSAtomicCompareAndSwapPtrBarrier() respectively). Thus will work rega... 阅读全文
posted @ 2010-10-25 23:09 史莱姆 阅读(276) 评论(0) 推荐(0)
摘要:SpinLock might be useful when a lock on a shared resource is not going to be held for very long. In such cases, on multi-core computers it can be efficient for the blocked thread to spin for a few cyc... 阅读全文
posted @ 2010-10-21 11:16 史莱姆 阅读(374) 评论(0) 推荐(0)
摘要:http://www.cs.rochester.edu/research/synchronization/pseudocode/queues.html/Files/slime/1996_PODC_queues.pdfPseudocode from article of the above name in PODC96 (with two typos corrected), by Maged M. ... 阅读全文
posted @ 2010-10-17 02:40 史莱姆 阅读(594) 评论(0) 推荐(0)
摘要:Shared-memory blocks are perhaps the fastest IPC mechanism, especially for transferring large structures between processes. However, they require careful synchronization, or subtle bugs can occur i... 阅读全文
posted @ 2010-09-24 05:20 史莱姆 阅读(454) 评论(0) 推荐(0)