From owner-freebsd-hackers Wed Jan 24 9:47:41 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from sttlpop3.sttl.uswest.net (sttlpop3.sttl.uswest.net [206.81.192.3]) by hub.freebsd.org (Postfix) with SMTP id CF4DB37B400 for ; Wed, 24 Jan 2001 09:47:23 -0800 (PST) Received: (qmail 8957 invoked by alias); 24 Jan 2001 17:47:13 -0000 Delivered-To: fixup-freebsd-hackers@FreeBSD.org@fixme Received: (qmail 8749 invoked by uid 0); 24 Jan 2001 17:47:09 -0000 Received: from www.a6l.net (HELO a6l.net) (63.229.13.49) by sttlpop3.sttl.uswest.net with SMTP; 24 Jan 2001 17:47:09 -0000 Received: (qmail 69549 invoked by uid 1002); 24 Jan 2001 17:47:21 -0000 To: freebsd-hackers@FreeBSD.org Subject: pthreads and kqueue From: Kevin Mills Date: 24 Jan 2001 09:47:21 -0800 Message-ID: <85ofwwkfkm.fsf@diablo.in.a6l.net> Lines: 22 X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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