[Pharo-project] [ANN] Atomic collections.
siguctua at gmail.com
Sat Oct 16 02:20:21 EDT 2010
as a result of recently happened discussion about atomic operations,
i implemented two kinds of thread-safe queues FIFO and LIFO,
which using atomic operations, instead of semaphore to add/remove items.
You may review it by loading the code from SqueakSource:
FIFOQueue scales much better than SharedQueue, and after some
additional testing can fully replace it.
I tested FIFOQueue by replacing a SharedQueue class for EventSensor (a
core system part, responsible for delivering events).
In attached file you can find a patch, which will make your sensor to
work with FIFOQueue, after you save image,
or do 'EventSensor install'.
There are also a heavy-concurrency tests in corresponding test
classes, which is passing ok.
Concurrency is highly complex field, thus i won't be surprised if code
still contains a bugs.
Code license is MIT, moreover a repository is publicly writeable, so
if you wanna add tests, benchmarks, fixes,
or implement new kind of lock-free container, feel free to do it.
Any feedback is welcome.
Igor Stasenko AKA sig.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1223 bytes
Desc: not available
More information about the Pharo-dev