alan buckley <[EMAIL PROTECTED]> wrote:

> The threading program had a different problem after that where
> the logic meant a pthread_yield was being called during a KILL signal
> handler. This reports:
> pthreads: *** fatal error aborting ***
> pthread_yield called with context switching disabled.
> 
> Should this really be a fatal error?

In most cases yes, as it is indicative of a major failure. Some of the
pthreads code relies on pthread_yield guaranteeing to cause a context
switch.

> If it should, is there anyway I can test for context switching being
> disabled in C code so I can avoid the call to pthread_yield.

Normally, context switching cannot be disabled outside of
unixlib code. However signal handlers are a special case, mostly because
when you get a serious signal such as a segfault it is hard enough
already making sure the recovery is robust, without worrying about
threading problems as well.

The real solution is to improve the signal handlers to support context
switching, but in the absense of that, don't try to call pthread_yield
from a signal handler.


Alex

-- 
Alex Waugh                                           [EMAIL PROTECTED]

PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/

_______________________________________________
GCCSDK mailing list [email protected]
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

Reply via email to