2009/10/23 Schwab,Wilhelm K <bschwab@anest.ufl.edu>:
Sig,
What about things like managing connections to remote hosts? Â Do I have a socket going over there? Â No?? Â Let's make one. Â Sounds like a great job for a shared dictionary.
it depends on your model, what you need to manage and how. If your goal is to communicate with remote hosts, where are sockets come from is not really relevant to you. Mainly you just getting a reference to object, which provides some facilities to you. How that object manages a collection of sockets, or does it manages them at all is not your concern.. And i wouldn't say that having a thread-safe collections is a big win for managing connections comparing to other possible implementations which not require any thread-safety for collections.
Bill
-----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Igor Stasenko Sent: Thursday, October 22, 2009 8:34 PM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Thread-safe collections
2009/10/23 Martin McClure <martin@hand2mouse.com>:
It's probably possible to write a hashed collection that is thread-safe and semaphore-free for both read and write, but unless there's a very specific requirement for that it's probably simpler, faster, and more reliable to just use a semaphore.
+1. If you traveling into the field of concurrency, you have to change the mindset. You should pick different abstractions for that. And collections is one which you should leave to grow in single-threaded woods. Or.. of course.. you can attempt to make them thread-safe.. But it will be clumpsy , rigid and very error prone.
Regards,
-Martin
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.