Re: [Qemu-devel] Coroutines and ucontext

2012-02-07 Thread Paolo Bonzini
On 02/07/2012 05:06 PM, Alex Barcelo wrote: Yes, I agree. But makecontext and swapcontext are not OK for my project (mainly because makecontext and swapcontext are not supported by qemu under PPC) so I was looking for alternatives. My best shot at the moment is using sigaltstack, if it works I wi

Re: [Qemu-devel] Coroutines and ucontext

2012-02-07 Thread Alex Barcelo
On Tue, Feb 7, 2012 at 12:18, Stefan Hajnoczi wrote: > On Sat, Jan 28, 2012 at 9:31 AM, Alex Barcelo wrote: >> On Fri, Jan 27, 2012 at 15:39, Paolo Bonzini wrote: I have a patch that uses sigsetjmp and siglongjmp instead of makecontext and getcontext (and all the ucontext stuff), and it

Re: [Qemu-devel] Coroutines and ucontext

2012-02-07 Thread Stefan Hajnoczi
On Sat, Jan 28, 2012 at 9:31 AM, Alex Barcelo wrote: > On Fri, Jan 27, 2012 at 15:39, Paolo Bonzini wrote: >>> I have a patch that uses sigsetjmp and siglongjmp instead of >>> makecontext and getcontext (and all the ucontext stuff), and it >>> *seems* to work... but I'm not sure if it works "by ac

Re: [Qemu-devel] Coroutines and ucontext

2012-01-28 Thread Alex Barcelo
On Fri, Jan 27, 2012 at 15:39, Paolo Bonzini wrote: >> I have a patch that uses sigsetjmp and siglongjmp instead of >> makecontext and getcontext (and all the ucontext stuff), and it >> *seems* to work... but I'm not sure if it works "by accident" (not >> sure what I'm doing to the stack, not sure

Re: [Qemu-devel] Coroutines and ucontext

2012-01-27 Thread Daniel P. Berrange
On Fri, Jan 27, 2012 at 03:39:22PM +0100, Paolo Bonzini wrote: > On 01/27/2012 01:39 PM, Alex Barcelo wrote: > >I have read that one of the reasons for using makecontext is that it > >saves the signal state. But there also exist functions like > >"sigsetjmp" and "siglongjmp" which can be used to ju

Re: [Qemu-devel] Coroutines and ucontext

2012-01-27 Thread Paolo Bonzini
On 01/27/2012 01:39 PM, Alex Barcelo wrote: I have read that one of the reasons for using makecontext is that it saves the signal state. But there also exist functions like "sigsetjmp" and "siglongjmp" which can be used to jump around the coroutines while preserving signal masks. I have a patch

[Qemu-devel] Coroutines and ucontext

2012-01-27 Thread Alex Barcelo
I have read that one of the reasons for using makecontext is that it saves the signal state. But there also exist functions like "sigsetjmp" and "siglongjmp" which can be used to jump around the coroutines while preserving signal masks. I have a patch that uses sigsetjmp and siglongjmp instead of