Re: Pattern for One-Entry-Multiple-Workers Problem
Stefan Schulz <[email protected]>
| Newsgroups | gmane.comp.java.sun.javaspaces |
|---|---|
| Message-ID | <[email protected]> |
Hi, from the response I understand, that my problem description was not clear enough. I shouldn't have used Xij but Yj(Xi), i.e. a Worker Wj produces exactly one new entry Yj based on the input Xi. This is done by all of the Workers concurrently, without them knowing about each other, and for: j != k follows that Yj(Xi) != Yk(Xi). The Xi and Yj(Xi) stay in the space until the manager decides the process to be finished, than he will take the Xi and all accordingly produced Yj(Xi) from the space. The ordered distributed data structure would not help, as it assumes the Xi to be consumed and only one output is expected from any of the Workers, which is not the case. Of course, one could do a contents() and iterate on all matching Xi, which would include taking it and having the actual object of the entry to support some signature feature, which can be checked and set during the loop. I just think, that this is no "elegant" solution :) Thanks, 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? >> =========================================================================== 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/