Won-Ho Kye <[EMAIL PROTECTED]> writes: > [1 <text/plain; iso-2022-kr (7bit)>] > Hi friends..! > > I am implementing the server application which have serval child > process. ><snip> > > The childs are forked from parent. > I oberved if the each child accept the socket simultaneous, > then the "accept" failed.. > Then I use the semophore to prevent simultaneous acception between > child processes. > Is there other efficient method?
Have you looked at the apache source? It will do something like this (that is, apache's main process will fork several different children at startup, and the children do the actual handling of the connections). If I remember correctly, apache somehow manages to have the parent process do the actual accept, and then pass it off to the child. (It somehow does this without re-doing a fork() after the accept). -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

