[ANN] Atomic collections.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] Atomic collections.

Igor Stasenko
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.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

sensor-queue-patch.1.cs (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] [ANN] Atomic collections.

Stéphane Ducasse

thanks
I would really like to have some solid basis for such kind of issue in pharo.

Stef
On Oct 16, 2010, at 8:20 AM, Igor Stasenko wrote:

> 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.
> <sensor-queue-patch.1.cs>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project