[squeak-dev] [ANN] Atomic collections.

Igor Stasenko siguctua at gmail.com
Sat Oct 16 06:20:21 UTC 2010


Hello,

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:

MCHttpRepository
    location: 'http://www.squeaksource.com/Atomics'
    user: ''
    password: ''


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.


-- 
Best regards,
Igor Stasenko AKA sig.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sensor-queue-patch.1.cs
Type: application/octet-stream
Size: 1223 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20101016/ba000b83/sensor-queue-patch.1.obj


More information about the Squeak-dev mailing list