[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: gentlehup

> -----Original Message-----
> From: Kurt D. Zeilenga [mailto:Kurt@OpenLDAP.org]

> >> Note that forking pthread applications is non-portable...

> >This isn't a major issue, all of the listeners are opened long before any
> >threads are created.
> Any call (including any call which the thread library might
> intercept from other libraries) into the thread library is
> problematic.
> >We can fork() after opening the listeners and have the
> >child process wait in a sigpause() until we want it to do 
> something. It will
> >consume practically no resources in the meantime.
> Yes.
> Another approach is to fork immediately and then, when needed,
> pass the listener/session descriptors to the child over a pipe (or
> such).  You can even pass some of the descriptors as their
> pending operations complete.  Of course, descriptor passing is
> not all that portable either.

Right. I would rather avoid any descriptor-passing code. I believe a
fork done early enough (while slapd is still single-threaded, no mutexes
are held or even exist) will be fine on any platform. 

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support