>>>>> "NI" == Nick Ing-Simmons <[EMAIL PROTECTED]> writes:
NI> Uri Guttman <[EMAIL PROTECTED]> writes:
>> i think we do because a thread can block on a mailbox while it can't on
>> an array.
NI> Why not ? - I see no reason that a "shared" array could not have
NI> whatever-it-takes to allow blocking.
then every op that could touch an array has to have code to support
blocking. i think that would be a mess. and what is the definition of
blocking on an array, is it empty? can i pop or shift it? how do you
handle atomicity? how do you specify a non-blocking access (poll) on an array?
mailboxes are defined to work fine with those requirements. a get on a
mailbox will block until one item is retrieved and that is an atoamic
operation. a get can be made non-blocking (polling) with a optional
argument.
uri
--
Uri Guttman --------- [EMAIL PROTECTED] ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com