Re: Pattern for One-Entry-Multiple-Workers Problem
Stefan Schulz <[email protected]>
| Newsgroups | gmane.comp.java.sun.javaspaces |
|---|---|
| Message-ID | <[email protected]> |
Dan Creswell wrote: > Does the Worker really need to modify the original Entry or could it > write a new one? If one had a unique id on the original Entry and put > the same id into the Entry produced by the worker, would that not be > good enough? > > Why do you need the worker to modify the original Entry - i.e. what's > the requirement you're trying to solve by updating the original Entry? > There may be other options if we understand more about the problem > you're trying to solve. > Maybe this provides a comparable real world scenario: Let us have a blackboard, where Calls for Papers are posted. Now, short-brained Ph.D. students (like me) read a newly posted CfP and produce according papers. As long as the students only react and see newly posted CfPs, this works fine. If we add an iteration mode, i.e., students regularily scan all available CfPs to write papers for each one (of course only one paper per CfP), they have to memorize the CfPs they have written papers for, i.e., either they log the information or they tag the CfP. In the first case, the log might get quite big over time, in the second case, they need write access to the CfP. Does this help? > Sorry, badly phrased - this has to do with Entry identity or the fact > that there isn't any. Sure it's a full copy but there could be more > than one Entry written to the space and just because you use the copy > received in the event to do a take provides no guarentee of which Entry > you'll actually take. The taken Entry might be the one that generated > the original event or it might be some other Entry written at some other > point in time. Sure, that's why I mentioned to add a field containing a unique Id. Cheers, Stefan =========================================================================== 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/