From owner-freebsd-stable Thu Mar 29 11: 0:54 2001 Delivered-To: freebsd-stable@freebsd.org Received: from mail01.actzero.com (cpe-24-221-167-196.ca.sprintbbd.net [24.221.167.196]) by hub.freebsd.org (Postfix) with ESMTP id 2222837B718 for ; Thu, 29 Mar 2001 11:00:51 -0800 (PST) (envelope-from blm@actzero.com) Received: by cpe-24-221-167-196.ca.sprintbbd.net with Internet Mail Service (5.5.2650.21) id ; Thu, 29 Mar 2001 11:00:45 -0800 Message-ID: From: Brian Matthews To: "'nate@yogotech.com'" Cc: "'freebsd-stable@freebsd.org'" Subject: RE: Threads vs. blocking sockets Date: Thu, 29 Mar 2001 11:00:44 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG | Right, but in threaded systems, there are no 'blocking' sockets. You | have to think differently when doing threaded applications. Well, at some level there aren't any blocking sockets anywhere. In nonthreaded programs, the kernel "loops" for you. I'd expect the wrapper to do the same in a threaded program, and in fact it does, sort of, catching EWOULDBLOCK/EAGAIN and suspending the thread if the socket is blocking. I could (almost :-)) see saying "sockets are always nonblocking in a threaded program", but the current implementation says "sockets can be 'half-blocking' (i.e. we'll handle not being able to transfer anything right now, but we won't handle a partial transfer) in a threaded program". Brian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message