harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evgueni Brevnov" <evgueni.brev...@gmail.com>
Subject [drlvm][threading] Is it safe to use hythread_suspend_all and hythread_resume_all?
Date Tue, 17 Oct 2006 08:30:39 GMT
Hi All,

I'd like to here you opinion regarding hythread_suspend_all and
hythread_resume_all functionality provided by TM. Actually I have to
separate questions:

1)  I found that hythread_suspend_all calls thread_safe_point_impl
inside. There is no assertion regarding thread's state upon entering
hythread_suspend_all. So it can be called in suspend disabled state
and nobody (at least me) expects to have a safe point during
hythread_suspend_all. The problem seems to be very similar with the
one discussed in "[drlvm][threading] Possible race condition in
implementation of conditional variables?" Your thoughts?

2) Assume I need to suspend all threads in particular group. Ok I pass
that group to hythread_suspend_all. Later when all suspended threads
should be resumed I pass the same group to hythread_resume_all. But
threads were suspended group has changed. For example one new thread
was added to it. So the questions are. Is it acceptable to have such
"unsafe" functionality? Would it better to lock the group in
hythread_suspend_all and unlock it in hythread_resume_all.

Thanks
Evgueni

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message