Re: Pattern for One-Entry-Multiple-Workers Problem

Mark Brouwer <[email protected]>
Newsgroups gmane.comp.java.sun.javaspaces
Message-ID <[email protected]>
Hi Stefan,

Stefan Schulz wrote:
> Hi,
>
> I am looking for a pattern to solve the following problem within
> JavaSpaces:
>
> - A Manager M writes Xi to the space.
> - Each participating Worker Wj reads Xi and produces Xij.
> - Each Wj should read a specific Xi only once.
> - Xi is written to the space, but never taken/removed.
>
> Where:
> - i and j are arbitrary numbers.
> - Xij is the result of an entry Xi processed by Worker Wj.
> - the number of produced Xi and participating Wj is not known.
> - the number of produced Xij is i x j.
>
> As far as I understood, a read on the space returns an arbitrary,
> matching entry, which (in worst case) always is the same entry. Is the
> above problem solvable within JavaSpaces at all? Or would one need
> JavaSpace05 to walk through all available matching entries and provide a
> signature/marking/logging-mechanism to check for unprocessed entries?
>

You could solve the above with an ordered distributed data structure
(see the book JavaSpaces Principels, Pattern, and Practice e.g.)
such as a distributed array, or a bit more flexible a channel. Gregg
gave an example of how to create the notion of a distributed array. I
think the next document will provide you enough information to get
started: http://www.artima.com/jini/jiniology/js6P.html.
--
Mark

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVASPACES-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

To view past JAVASPACES-USERS postings, please see:
http://archives.java.sun.com/archives/javaspaces-users.html

JDC members can download the JavaSpaces(tm) Technology from:
http://developer.java.sun.com/developer/products/jini/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.