harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao-Feng Li" <xiaofeng...@gmail.com>
Subject Re: [drlvm][thread] question on hythread_suspend_enable and tmn_suspend_enable
Date Fri, 01 Jun 2007 14:11:49 GMT
On 6/1/07, Pavel Afremov <pavel.n.afremov@gmail.com> wrote:
> Line "assert(hythread_is_suspend_enabled());" is wrong and should be
> replaced by "assert(!hythread_is_suspend_enabled());"

Thanks, Pavel.

Let's ask threading guy to fix it.

Thanks,
xiaofeng

> Thanks.
> Pavel Afremov.
>
> On 6/1/07, Xiao-Feng Li <xiaofeng.li@gmail.com> wrote:
> >
> > On 6/1/07, Pavel Pervov <pmcfirst@gmail.com> wrote:
> > > hythread_suspend_disalbe is allowed to be called recursively.
> > > tmn_suspend_disable is not. That is the difference.
> > >
> > > WBR,
> > >     Pavel.
> >
> > Thanks, Pavel.  It helps, but I still don't understand if the question
> > 2) is indeed a problem, i.e., the code calls tmn_suspend_disable()
> > first, then calls assert(hythread_is_suspend_enabled()). Does that
> > mean tmn_suspend_disable() actually doesn't really disable the
> > suspension? Thanks for further explanations.
> >
> >
> > -xiaofeng
> >
> > >
> > > On 6/1/07, Xiao-Feng Li <xiaofeng.li@gmail.com> wrote:
> > > >
> > > > Hi, folks, I am having some difficulty in understanding the usage
> > > > difference between hythread_xxx()  procedures and tmn_xxx() series for
> > > > thread suspension control.
> > > >
> > > > 1). Looks like they are used interchangeably (?) .
> > > >
> > > > For example,
> > > >
> > > > In file vm/vmcore/src/init/vm_init.cpp,
> > > >
> > > > 576:        hythread_suspend_enable();
> > > > 577:        exn_print_stack_trace(stderr, exn_get());
> > > > 578:        hythread_suspend_disable();
> > > >
> > > >
> > > > In file vm/vmcore/src/exception/exceptions.cpp,
> > > >
> > > > 619:    tmn_suspend_disable();
> > > > 620:
> > > > 621:    ManagedObject *exn = exc->object;
> > > > 622:    exn_native_print_stack_trace(f, exn);
> > > > 623:
> > > > 624:    tmn_suspend_enable();
> > > >
> > > > 2). A code snippet I can't understand:
> > > >
> > > > In file vm/vmcore/src/exception/exceptions.cpp,
> > > >
> > > > 549: inline void exn_native_print_stack_trace(FILE * f, ManagedObject
> > *
> > > > exn)
> > > > 550: {
> > > > 551:
> > > > 552:    assert(hythread_is_suspend_enabled());
> > > >
> > > > If we see the line 552 here and line 619 above (both in
> > > > exceptions.cpp), we may find they are contraditory (?) . The flow
> > > > disables suspension and calls into a function which requires
> > > > suspension enabled. Why is that?
> > > >
> > > > Can DRLVM thread guy please give some explantions on the two
> > questions?
> > > >
> > > > Thanks,
> > > > xiaofeng
> > > > --
> > > > http://xiao-feng.blogspot.com
> > > >
> > >
> > >
> > >
> > > --
> > > Pavel Pervov,
> > > Intel Enterprise Solutions Software Division
> > >
> >
> >
> > --
> > http://xiao-feng.blogspot.com
> >
>


-- 
http://xiao-feng.blogspot.com

Mime
View raw message