Re: Pattern for One-Entry-Multiple-Workers Problem
Dan Creswell <[email protected]>
| Newsgroups | gmane.comp.java.sun.javaspaces |
|---|---|
| Message-ID | <[email protected]> |
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. So each worker produces one new Entry Xij in response to an Xi? > - Each Wj should read a specific Xi only once. > - Xi is written to the space, but never taken/removed. > Hmmm, how do you prevent resource exhaustion? It you only ever write and never clean these items out (maybe you're using leases?), over time you'll run out of disk or memory surely? > 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? > Maybe, although you may be able to use one of the notify() types of behaviour to solve this more efficiently such that you only need to sometimes do a contents() in order to catch any Entry's for which you didn't get a notify...... Dan. =========================================================================== 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/