Date: Thu, 16 Nov 2000 15:20:29 -0800 (PST) From: FengYue <fengyue@bluerose.windmoon.nu> To: freebsd-hackers@FreeBSD.ORG Subject: Re: Multithreaded tcp-server or non-blocking ? Message-ID: <Pine.BSF.4.21.0011161515560.18678-100000@shell.unixbox.com> In-Reply-To: <200011162235.RAA27714@thunderer.cnchost.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 16 Nov 2000, Bakul Shah wrote: ->The simplest solution is to just fork a new process on ->accepting a new connection. A sample implementation is why not just bind to the port and then spawn off some processes (like 20 in his case) to do the accept(), once the accept() returns successfully just take care of the request, close the connection and then goes back to accept(). Simple, easy, and even scales pretty well. Since it's freebsd, you even don't need to worry about putting a lock around the accept() call. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0011161515560.18678-100000>