From owner-freebsd-current@FreeBSD.ORG Sun Dec 28 10:02:54 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A0EC916A4CE; Sun, 28 Dec 2003 10:02:54 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3872943D1D; Sun, 28 Dec 2003 10:02:53 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hBSI2qiw026485; Sun, 28 Dec 2003 13:02:52 -0500 (EST) Date: Sun, 28 Dec 2003 13:02:52 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Alfred Perlstein In-Reply-To: <20031228071712.GI9623@elvis.mu.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: davidxu@freebsd.org cc: current@freebsd.org Subject: Re: debugging kse X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Dec 2003 18:02:54 -0000 On Sat, 27 Dec 2003, Alfred Perlstein wrote: > * Daniel Eischen [031227 22:41] wrote: > > On Fri, 26 Dec 2003, Alfred Perlstein wrote: > > > > > I have a copy of webstone that will use kse available here: > > > http://people.freebsd.org/~alfred/webstone/ > > > > Here's a diff to eliminate TLS usage in webstone. It can > > be cleaned up further, and I can't see any reason for the > > use of TLS. Operations on FILE should be thread-safe and > > the remaining uses of TLS were mostly for temporary string > > manipulations. > > > > http://people.freebsd.org/~deischen/webstone.diffs > > > > I haven't enabled threads, but it should be simple enough. > > Note that you want the parent thread to call alarm(), not > > each child thread (client). I'd have the parent thread use > > sigwait() to catch the signal, set the flag for the other > > clients to see, then join to the client threads. I don't > > see any need for synchronization objects/semaphores. > > heh! > > A bit ahead of you over here... > http://people.freebsd.org/~alfred/webstone/ I don't see why you want to emulate the windows API when it is much simpler to add in the necessary pthread bits when threads are enabled. I updated my patch to add in pthread support for webclient (see patch-ad): http://people.freebsd.org/~deischen/webstone.diffs I didn't add any of the necessary configure stuff that is in your patch. I also didn't add a synchronization point to start the client threads off and running. The fork() method didn't use any so I didn't see why using threads would be any different. I did join to the threads at the end, but even that isn't necessary since they will continue to run after the main thread ends (until the alarm goes off). I'm still not sure how to test this. Do I need a web server? -- Dan Eischen