- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Tags:
- Parallel Computing
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ClayB wrote:
Intel Developer Services has posted an article on threaded programming (see http://www.intel.com/cd/ids/developer/asmo-na/eng/151201.htm) titled "Multiple Approaches to Multithreaded Applications." The topic focuses on use of locks and lock-free methods, which makes the title a bit misleading, IMO.
----------------------------------
The article references my site, its a good thing that it has correct code posted!
BTW, I am SenderX on comp.programming.threads.
There is a flaw in the paper Its example of a lock-free LIFO stack suffers from a horrible race-condition known as ABA. You need to atomically increment a version counter on every successful pop operation, and the counter needs to be maintained throughout the popped nodes lifetime for correctness. Also, there is a reference to a French paper, it is flawed as well. I think it can suffer from ABA in the first cas of the lock-free queue push function. It needs to be a double-wide cas.
-----------------------------
Are there different or better methods than those presented in the paper?
------------------------------
Yes. Kernel or User-Space RCU, Joes atomic_ptr, my proxy gc, SMR
I can post some links if you want.
------------------------------
Should performance merit any consideration when choosing one implementation over any other (e.g., locks vs. semaphores)to perform the same function?
-------------------------------
It depends if you want your thread-to-thread communication to be heavily fast-pathed and potentially block only when it absolutely needs to? Linux FUTEX is an example of this. A fast-path can be equated to a lock-free path, because the call into the kernel is avoided.
Sometimes its good to use locks. Like RCU It relies on locks for the write side( call_rcu ) of the algorithm.
Anyway, I will get into this in a lot more detail when I finish up my portable lock-free library. It will run on pthread enabled i686 UNIXs. It can easily be ported to 32-bit and 64-bit SPARC and PPC. It can even port to AMD64 and Itanium.
The library will be about as portable as the Linux FUTEX API. My new stuff really shows off how SMP and/or HyperThreading can really increase the throughput of thread-to-thread communication.
:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If your going to do DCL, you need to use the proper atomic ops mixed with the correct memory barriers. Also, you "need to know" your biatch compiler inside in out. It can really screw youbadwhen it comes to this stuff.
'your "biatch" compiler inside in out.'
I meant, your biatch compiler!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page