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: > Dan Creswell wrote: >> Checkout the JavaSpace05 and AvailabilityEvent JavaDoc. > > Gna, one should check the correct Interface to find out about its > abilities. THANKS A LOT!!! > No problems. Phew, I thought I was being positively braindead as opposed to simply stupid :) > So as an AvailabilityEvent, in opposite to a RemoteEvent, returns a copy > of the entry object, I could actually use an ID-field within the entry Yes, well that's one difference there are others of course. > to later on take and modify the specific entry object. That's all I Yes, you could do that though if all your Workers want that Entry you'll obviously get conflict/potential reduction in concurrency though this can be avoided to a certain degree with reasonably smart (though not trivial) worker code. Regardless, it sounds like you may be migrating towards a need to do this take() kind of thing in which case a unique id is a useful thing to have lying around. > need, I guess. (Wonder, why the RemoteEvent does not provide a handle or > something to do so, as it seems obvious to be a wanna have thingy.) Well, one reason is to ensure that users don't mistakenly think the Entry in the event is _the_ entry. It also helps to remind users that just because you've received the event, it doesn't guarentee the Entry is still available (someone else could've taken it). When the community went through the process of spec'ing JavaSpace05, it was concluded that few users were making such a mistake but that backward compatibility was a good thing hence notify() wasn't modified. > I don't care about "missed" notifications for now so this is all I need, > this mailing list rulez :D > Glad to have been of service, 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/