All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] rcu: support fork
@ 2015-03-06  9:22 Paolo Bonzini
  2015-03-06  9:22 ` [Qemu-devel] [PATCH 1/2] qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK Paolo Bonzini
  2015-03-06  9:22 ` [Qemu-devel] [PATCH 2/2] rcu: handle forks safely Paolo Bonzini
  0 siblings, 2 replies; 5+ messages in thread
From: Paolo Bonzini @ 2015-03-06  9:22 UTC (permalink / raw)
  To: qemu-devel

Supporting fork in multithreaded programs is somewhat complicated,
however in QEMU we fork in two places (daemonize and smbd) and none of
them are complicated:

- daemonize happens before threads and mutexes proliferate unpredictably;
only the RCU state has to be reset and the call_rcu thread recreated

- smbd mostly does an exec in the child.

Unfortunately, glibc also makes forking terminally incompatible with
PTHREAD_MUTEX_ERRORCHECK, so you also need to disable that.

Paolo

Paolo Bonzini (2):
  qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK
  rcu: handle forks safely

 util/qemu-thread-posix.c |  6 +-----
 util/rcu.c               | 34 +++++++++++++++++++++++++++++++++-
 2 files changed, 34 insertions(+), 6 deletions(-)

-- 
2.3.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-07 17:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-06  9:22 [Qemu-devel] [PATCH 0/2] rcu: support fork Paolo Bonzini
2015-03-06  9:22 ` [Qemu-devel] [PATCH 1/2] qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK Paolo Bonzini
2015-03-06 15:54   ` Eric Blake
2015-03-07 17:05     ` Paolo Bonzini
2015-03-06  9:22 ` [Qemu-devel] [PATCH 2/2] rcu: handle forks safely Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.