>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:

  DS> Nope. The code that accessses the array needs to support it. Different 
  DS> animal entirely. The ops don't actually need to know.

but still that is overhead code for all arrays and not just the mailbox
ones.

  DS> s/mailboxes/filehandles/;

  DS> If we're talking a generic communication pipe between things, we
  DS> should overload the filehandle. It's a nice construct that
  DS> provides an ordered, serialized, blockable, pollable
  DS> communications channel with well-defined behavior and a
  DS> comfortable set of primitives to operate on it.

pollable is a good thing. some mailbox designs are not pollable and some
are. i like the idea of supporting polling then you can also have
callbacks. but this does imply an implementation as semaphores and
shared memory are not pollable. you would have to build this with pipes
and filehandles.

overlaying it on filehandles is another question. i would like to see a
single operation which does an atomic lock, block, retrieve, unlock. we
don't have that for filehandles.  you could use a new method on that
special handle (i like 'get') which has the desired semantics.

i think making mailboxes in some form is a good idea. but they should be
special objects (even if they are filehandles) with their own methods to
support the desired semantics.

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

Reply via email to