Artur Bergman wrote:

> >> From what I understand perl doesn't accquire any mutexes,lock,conditions
> >> when running in separete threads using USEITHREAD. So this problem will only
> >> exist with shared data between threads.
> >
> > Not so.  If two ITHREADS both call a MT-unsafe library function (e.g.
> > strtok()) then breakage will ensue.
> 
> What has this to do with longjmp/setjmp?

Nothing - I was just pointing out that shared data isn't the only issue, and
that even locking doesn't necessarily make a MT-unsafe function safe.

> >> I tried looking at the src but I haven't learnt to properly navigate it, but
> >> if perl does this on error handling, then the code that handles the sharing
> >> must ensure not to call longjmp while it holds any mutex. If a user holds
> >> any lock while his program handles error, then he must handle them aswell.
> >
> > How?
> >
> 
> eval {
>     lock($foo);
>     die;
> };
> if($@) {
>     #Make sure to unlock everything or you are toast
> }

I await your diff for the perl source with eager anticipation.

;-)

Alan Burlison

Reply via email to