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:
> 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.

You are right, this definitely will be a problem.

> 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.

Hm, after some thoughts, this notification seems only to help, if I
really do not take and modify entries, as a worker will be notified, if
he himself or any other worker puts an entry to the space matching a
template the Worker registered (which would happen in my case, as it
would only modify the original object and not the entry's properties).
On the other hand, if the entry is signed, the worker would not (try to)
take it again, so it would only be a reading overhead.

> Well, one reason is to ensure that users don't mistakenly think the
 > Entry in the event is _the_ entry.

But the entry in the event will contain a copy of the original object,
too, won't it? Not only the (visible) fields.


In the end, there is still the alternative to (externally) trigger a
contents()/iterator-base operation, as mentioned by Gregg. Although, not
very elegant, maybe the easiest and most complete way to do it. Hm.

> Glad to have been of service,

It's great, as it does not only help solving my problem, but also to
properly define it. :)

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/
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.