Is Set growth thread-safe?

goran at krampe.se goran at krampe.se
Wed Sep 21 07:09:54 UTC 2005


Hi!

Ross Boylan <RossBoylan at stanfordalumni.org> wrote:
[SNIP]
> I thought smalltalk was supposed to be thread-safe with respect to its
> own threads.  Am I mistaken in that belief, or in my analysis that the
> operation is not thread safe?

Well, I think you are mistaken in that belief. :) AFAIK most classes are
not thread safe at all, and not intended to be either. Then we have
specific classes to deal with threads having to share objects - like
Semaphore, Monitor, SharedQueue, my SharedStreams package on SM etc.

Personally I think this is the "right way" to do it, no need to add
complexity and overhead unless you know you need it. And typically I
would say the objects shared by multiple Processes should be known and
taken care for case by case. Or else you should use a transactional
object memory - like say Magma/GemStone gives you. Just my 2 cents.

regards. Göran

PS. <advoc>My SharedStreams has been recommended by others to replace
SharedQueue btw, it is more efficient and has less "issues" AFAIK. And
more features. :) </advoc>



More information about the Squeak-dev mailing list