From owner-freebsd-hackers Wed Jan 24 22:45:10 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from resnet.uoregon.edu (resnet.uoregon.edu [128.223.122.47]) by hub.freebsd.org (Postfix) with ESMTP id 01E5F37B400 for ; Wed, 24 Jan 2001 22:44:53 -0800 (PST) Received: from localhost (dwhite@localhost) by resnet.uoregon.edu (8.10.1/8.10.1) with ESMTP id f0P6ig927135; Wed, 24 Jan 2001 22:44:46 -0800 (PST) Date: Wed, 24 Jan 2001 22:44:42 -0800 (PST) From: Doug White To: Kevin Mills Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: pthreads and kqueue In-Reply-To: <85ofwwkfkm.fsf@diablo.in.a6l.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 24 Jan 2001, Kevin Mills wrote: > My question: Is it considered "safe" to have a number of threads each > waiting on a call to kevent() using the same kqueue? Or do I need to > have one thread waiting on the kevent() call and have it dispatch jobs > to the waiting threads? You should probably assume that kqueue/kevent() & friends are not thread-safe. I would suggest using a separate dispatcher thread that sits on the kqueue and wakes up threads as needed. This would be much more efficient than per-thread kqueues. This seems like a strange way to implement your solution, though ... from the sounds of it, you can only have one concurrent connection to your authentication server via this library, which sounds extremely lame. Do the clients just sit around forever until the server returns? The serialization this library forces isn't too scalable. Doug White | FreeBSD: The Power to Serve dwhite@resnet.uoregon.edu | www.FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message