Any thread-safe collection for Pharo?

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

Any thread-safe collection for Pharo?

Denis Kudriashov
Hello.

Anybody know thread-safe collections project?
Reply | Threaded
Open this post in threaded view
|

Re: Any thread-safe collection for Pharo?

Sven Van Caekenberghe-2
There is SharedQueue that I know of.

LRUCache and TTLCache can #beThreadSafe.

In general it is easy enough to put something in front of your collection access.

If you want concurrent and interleaved access to the same collection by multiple threads while modifying the collection, that is something else ;-)

> On 22 Dec 2015, at 09:41, Denis Kudriashov <[hidden email]> wrote:
>
> Hello.
>
> Anybody know thread-safe collections project?


Reply | Threaded
Open this post in threaded view
|

Re: Any thread-safe collection for Pharo?

Denis Kudriashov

2015-12-22 10:28 GMT+01:00 Sven Van Caekenberghe <[hidden email]>:
There is SharedQueue that I know of.

LRUCache and TTLCache can #beThreadSafe.

In general it is easy enough to put something in front of your collection access.

I want something more simple which not force me to remember what is semaphore, monitor, mutex  or whatever. Something like this:

threadSafeCollection := AnyCollectionClass threadSafe.
or
threadSafeCollection := AnyCollectionInstance threadSafe.
or more general
threadSafeObject := AnyObjectInstance threadSafe

Thread safe wrappers should allow concurrent reads which blocked on writes and writes which blocked on anything. 
For example collection #add: method should wait until current #do: or #add: completes.  And #do: should wait until current #add: completes. 
Reply | Threaded
Open this post in threaded view
|

Re: Any thread-safe collection for Pharo?

stepharo
there is AtomicQueue

I want something more simple which not force me to remember what is semaphore, monitor, mutex  or whatever. Something like this:

threadSafeCollection := AnyCollectionClass threadSafe.
or
threadSafeCollection := AnyCollectionInstance threadSafe.
or more general
threadSafeObject := AnyObjectInstance threadSafe

Thread safe wrappers should allow concurrent reads which blocked on writes and writes which blocked on anything. 
For example collection #add: method should wait until current #do: or #add: completes.  And #do: should wait until current #add: completes.

I do not think that we have such behavior.

Reply | Threaded
Open this post in threaded view
|

Re: Any thread-safe collection for Pharo?

Igor Stasenko
IIRC AtomicQueue is not part of collection(s) family.

On 24 December 2015 at 07:41, stepharo <[hidden email]> wrote:
there is AtomicQueue

I want something more simple which not force me to remember what is semaphore, monitor, mutex  or whatever. Something like this:

threadSafeCollection := AnyCollectionClass threadSafe.
or
threadSafeCollection := AnyCollectionInstance threadSafe.
or more general
threadSafeObject := AnyObjectInstance threadSafe

Thread safe wrappers should allow concurrent reads which blocked on writes and writes which blocked on anything. 
For example collection #add: method should wait until current #do: or #add: completes.  And #do: should wait until current #add: completes.

I do not think that we have such behavior.




--
Best regards,
Igor Stasenko.