Re: Seeming Non-determinism in Java Programs
Stephen Denne <[email protected]> Mon, 7 Apr 2008 15:07:38 +1200
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <[email protected]> |
Randall R Schulz wrote:
> The queue is
> implemented using a heap, though alternatives such as Skip-Lists are
> available as options (mostly implemented because of the issue I'm
> writing about here).
You haven't explicitly mentioned it... but are you using java.util.PriorityQueue?
...
> It's worth noting that it's often the case that there is relatively
> little distinction between actual FOM values (they are very frequently
> always small integers). While the priority queue may at any time hold
> several thousand items, there may be only a relative handful of
> distinct FOMs ordering that queue. Note, too, that the heap data
> structure is not stable w.r.t. equal key (FOM) values.
Have you tried (for the purpose of finding out more about the behaviour of your system, rather than for algorithmic correctness) extending your FOM, or FOM Comparator within your heap, to never have any two equal values, but to deterministically pick one as before the other?
Regards,
Stephen Denne.
Disclaimer:
At the Datamail Group we value team commitment, respect, achievement, customer focus, and courage. This email with any attachments is confidential and may be subject to legal privilege. If it is not intended for you please advise by reply immediately, destroy it and do not copy, disclose or use it in any way.
__________________________________________________________________
This email has been scanned by the DMZGlobal Business Quality
Electronic Messaging Suite.
Please see http://www.dmzglobal.com/dmzmessaging.htm for details.
__________________________________________________________________
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com