From owner-freebsd-stable Thu Mar 29 11: 5:28 2001 Delivered-To: freebsd-stable@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id B3E0E37B727 for ; Thu, 29 Mar 2001 11:05:22 -0800 (PST) (envelope-from nate@yogotech.com) Received: from nomad.yogotech.com (nomad.yogotech.com [206.127.123.131]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id MAA07137; Thu, 29 Mar 2001 12:05:20 -0700 (MST) (envelope-from nate@nomad.yogotech.com) Received: (from nate@localhost) by nomad.yogotech.com (8.8.8/8.8.8) id MAA12492; Thu, 29 Mar 2001 12:05:20 -0700 (MST) (envelope-from nate) From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15043.34596.749224.205511@nomad.yogotech.com> Date: Thu, 29 Mar 2001 12:04:04 -0700 (MST) To: Brian Matthews Cc: "'nate@yogotech.com'" , "'freebsd-stable@freebsd.org'" Subject: RE: Threads vs. blocking sockets In-Reply-To: References: X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) 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". Again, in other threading systems I've used, the caller must check to see if the call has sent all the data. FreeBSD is not special in this regard. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message