On 6/14/2019 8:51 AM, Ranier Vf wrote:
> Maybe this help.
> http://www.doublersolutions.com/docs/dce/osfdocs/htmls/develop/appdev/Appde193.htm
>
> "One solution to the problem of calling *fork( )* in a multithreaded
> environment exists. (Note that this method will not work for server
> application code or any other application code that is invoked by a
> callback from a library.) Before an application performs a *fork( )*
> followed by something other than *exec( )*, it must cancel all of the
> other threads. After it joins the canceled threads, it can safely *fork(
> )* because it is the only thread in existence. This means that libraries
> that create threads must establish cancel handlers that propagate the
> cancel to the created threads and join them. The application should save
> enough state so that the threads can be recreated and restarted after
> the *fork( )* processing completes. "
Yes, this helps. As long as nginx has been designed to honor these
rules, we can make our application do the same thing.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel