From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Wed Sep 30 1998 - 19:24:16 EDT
> Oh great - so the longjmp on the Sparc/Linux unrolls the stack when you
> do a longjmp to the indicated point in the jmpbuf ... which is just fine
> if your using setjmp/longjmp for their usual purpose, but no so good if
> you use it to create threads. I'm looking for a work around ... but it
> anyone knows one please let me know.
What I used to do is the following at thread creation time:
create() {
malloc stack
setjmp in the father
the if (setjmp (...)) { launch child process ()
Using global variables only
suicide()
}
else {
modify the SP using the apriori knowledge of the SP index
in the jmpbuf (father)
}
}
Under that scheme, the fact that the longjmp unroll the stack is harmless,
(I remember however that AIX was checking for the SP and exit()ing if not
"within range" :-(, I had to rewrite them).
That's lead to the second possiblility: take setjmp/longjmp from S/Linux
libc and modify it, *grin* ...
Daniel
-- Daniel.Veillard@w3.org | W3C MIT/LCS NE43-344 | Today's Bookmarks : Tel : +1 617 253 5884 | 545 Technology Square | Linux, WWW, rpm2html, Fax : +1 617 258 5999 | Cambridge, MA 02139 USA | badminton, Kaffe, http://www.w3.org/People/W3Cpeople.html#Veillard | HTTP-NG and Amaya.
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:56:58 EDT