Skip site navigation (1)Skip section navigation (2)
Date:      24 Jan 2001 09:47:21 -0800
From:      Kevin Mills <kmills@a6l.net>
To:        freebsd-hackers@FreeBSD.org
Subject:   pthreads and kqueue
Message-ID:  <85ofwwkfkm.fsf@diablo.in.a6l.net>

next in thread | raw e-mail | index | archive | help

A little background:

I have an application that uses kqueue to manage many, many sockets (and it 
works wonderfully, btw).  I'm using non-blocking I/O, so my application 
can certainly work without threads.  However, each incoming connection needs 
to access a back-end RADIUS or LDAP server and, due to the libraries I must
use, these accesses do block.

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?

For simplicity reasons, I would like to have each thread waiting on 
a kevent() call, but I want to ensure I wouldn't get strange behavior - like 
more than one thread waking up for the same event or other strangeness.  I've
looked at kern_event.c and it looks like I'll be OK, but I am not intimately
familiar with kevent's workings, so hopefully someone can give me an educated
answer :)

Thanks for any help!


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?85ofwwkfkm.fsf>