deadlock detection

Andrew Haley aph@redhat.com
Thu Sep 11 17:16:00 GMT 2003


Jacob Gladish writes:
 > I've implemented a small simulation of a Wait For Graph that I'd like to
 > fit into the current runtime,
Cool.
 > but I'm unsure of what data structures to use. My current
 > implementation uses the stl, since it was easy and quick to nail
 > the algorithm down. I'm not sure what data structures to use when
 > putting this into the runtime. Is it ok to use the collections from
 > java::util?
Perhaps, but maybe java::util uses locks, and if so locks can't use
java::util.
 > What I currently have planned is to add hooks into the
 > _Jv_MonitorEnter/_Jv_MonitorExit calls to adjust the graph state,
 > and the finalize_native to remove any thread entries from the
 > graph. Is it ok to reference the collections from this level or do
 > new data structures need to be written from scratch?
There's no law against it, but you must make very very sure that the
collections classes you use don't call _Jv_MonitorEnter. I don't
think you can guarantee that, because class initialization acquires a
lock. Tricky.
Andrew.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /