Re: [Qemu-devel] [PATCH] rcu: do not create thread in pthread_atfork callback

2015-03-31 Thread Peter Maydell
On 31 March 2015 at 13:55, Paolo Bonzini wrote: > > > On 31/03/2015 13:41, Peter Maydell wrote: >>> > static void __attribute__((__constructor__)) rcu_init(void) >>> > { >>> > #ifdef CONFIG_POSIX >>> > -pthread_atfork(rcu_init_lock, rcu_init_unlock, rcu_init_child); >>> > +pthread_atfor

Re: [Qemu-devel] [PATCH] rcu: do not create thread in pthread_atfork callback

2015-03-31 Thread Paolo Bonzini
On 31/03/2015 13:41, Peter Maydell wrote: >> > static void __attribute__((__constructor__)) rcu_init(void) >> > { >> > #ifdef CONFIG_POSIX >> > -pthread_atfork(rcu_init_lock, rcu_init_unlock, rcu_init_child); >> > +pthread_atfork(rcu_init_lock, rcu_init_unlock, rcu_init_unlock); >> >

Re: [Qemu-devel] [PATCH] rcu: do not create thread in pthread_atfork callback

2015-03-31 Thread Peter Maydell
On 31 March 2015 at 12:01, Paolo Bonzini wrote: > If QEMU forks after the CPU threads have been created, > qemu_mutex_lock_iothread > will not be able to do qemu_cpu_kick_thread. There is no solution other than > assuming that forks after the CPU threads have been created will end up in an > exe