Date: Fri, 26 Nov 1999 13:20:52 -0600 (CST) From: Rob King <dimwit@pernet.net> To: freebsd-hackers@freebsd.org Subject: PThreads and Sockets Message-ID: <Pine.BSF.4.20.9911261320150.11874-100000@deadpixi.pernet.net>
next in thread | raw e-mail | index | archive | help
Hi all, I'm writing a server that multiplexes a MySQL connection to several clients. Since the connection has to be shared, I can't fork(), I have to thread. This isn't a problem, except that when I accept() and assign a socket descriptor, the first thread runs fine, but the next thread simply grabs the descriptor (since it's shared) from the previous thread and starts doing all its writing to that socket. Any idea how to get around this? If there's any good example code, please let me know. Thanks, Rob -- dimwit@pernet.net http://ota.pernet.net/ 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.20.9911261320150.11874-100000>