Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jan 2001 22:44:42 -0800 (PST)
From:      Doug White <dwhite@resnet.uoregon.edu>
To:        Kevin Mills <kmills@a6l.net>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: pthreads and kqueue
Message-ID:  <Pine.BSF.4.21.0101242235180.25771-100000@resnet.uoregon.edu>
In-Reply-To: <85ofwwkfkm.fsf@diablo.in.a6l.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0101242235180.25771-100000>