Re: [jgrapht-users] Bizarre issue with TopologicalOrderIterator
Brought to you by:
barak_naveh,
perfecthash
From: Alexander H. <ale...@my...> - 2014-12-04 13:20:51
|
That is java for you, data structures using hashes often use the value of references to compute the hash. Since the pointer values may change every run, the order things are iterated over may change every run (there is no guarantee that the n-th call to malloc in an application always yields the same address). In order to make your application deterministic and debugable you want to use LinkedHash.. data structures. These guarantee deterministic behaviour (in single threaded execution). Alex On 04.12.2014 13:50, org...@io... wrote: > On 2014-12-03T22:18:50 -0800 > John Sichi <js...@gm...> wrote: > >> I don't see any dependency between Q and N in your code, so why do you >> think their relative order would be deterministic? > Hah, I guess that'd be the "question my own sanity" part - I had no idea > the algorithm even could be nondeterministic. Out of idle curiousity, > how does this happen? I didn't notice any concurrency or anything along > those lines. > > I see that the lack of dependency between Q and N does allow that > returned order to make sense! I'll fix the test. > > M > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users |