This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: deadlock detection


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]