Newsgroups: comp.programming.threads
From: "SenderX" <x...@xxx.xxx>
Date: Sat, 23 Aug 2003 15:45:21 GMT
Local: Sat, Aug 23 2003 11:45 am
Subject: Re: Wefts is out
> Because I wanted to implement some lock free algo as separate classes, This is one of the best lock-free lists out there: like > the lock free list. http://www.cs.tau.ac.il/~shanir/reading%20group/p73-michael.pdf You can implement this algo. in x86. I already have, and will probably post the code. I have a special lock-free read-write mutex, that will allow for objects > You know that lock free algos are not always the best, Yep. That's what IOCP is for. On Win32 that is... > or even not always desiderable (i.e. if you want to wait for a socket to > become readable ;) > So, I would give it a try and put them on wefts... Yes, you could put them in a separate namespace: Wefts::LockFree::x86:: Here is another cool lock-free linked-list, using the wonderful atomic_ptr: http://groups.google.com/groups?selm=3EF64AA8.180483F2%40xemaps.com Here is atomic_ptr: http://groups.google.com/groups?selm=3E6B7923.57B88B09%40xemaps.com&r... This is a cas64 function: /* Atomic 64-bit Cas */ cas64 { unsigned char ucRet; __asm /* Read exchange */ /* Read dest */ /* Execute */ #ifdef AC_BUILD_PROC_SMP lock cmpxchg8b qword ptr [esi] #else cmpxchg8b qword ptr [esi] #endif /* Test */ /* Update comprand */ cas64_Success: return ( ucRet ) ? true : false; } Pointer passed as dest, will have to be QWORD aligned, on SMP box's. -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||