Subj : Re: segmentation fault while using setjmp To : comp.os.linux.development.system,comp.os.linux,comp.os.linux.questions From : Kasper Dupont Date : Thu Jul 01 2004 07:36 am naveen wrote: > > i realize that there are a lot of pitfalls while using the > setjmp/longjmp pair for multithreading. Portability is not my first > concern. i think i can use assembly code (386) for saving the > registers and doing the context-switch. > Please point me to some literature relating to this Actually you can do the switching without using any assembler code. I have an example here that did work: http://www.daimi.au.dk/~kasperd/scheduler.c This is far from perfect, and not portable. I rely on the exact stack layout. In fact I don't even remember with which compiler version it did work. -- Kasper Dupont -- der bruger for meget tid paa usenet. For sending spam use kasperd@kd.lir.dk and abuse@kd.lir.dk I'd rather be a hammer than a nail. .