From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Nic Ferrier Newsgroups: gmane.emacs.devel Subject: non-blocking sockets (was Re: Are there plans for a multi-threaded Emacs?) Date: 04 Dec 2003 16:26:12 +0000 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87k75czh0b.fsf_-_@kanga.tapsellferrier.co.uk> References: <87oevbes4h.fsf@emacswiki.org> <20031117040607.C6C5D79B72@server2.messagingengine.com> <87ekvpx18d.fsf@emptyhost.emptydomain.de> <4nad6cikxy.fsf@holmes.bwh.harvard.edu> <4nllpt3hr3.fsf@lockgroove.bwh.harvard.edu> <5bad69zd43.fsf@lister.roxen.com> <4noeuon378.fsf@lockgroove.bwh.harvard.edu> <87ptf4zib0.fsf@kanga.tapsellferrier.co.uk> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1070555762 9090 80.91.224.253 (4 Dec 2003 16:36:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 Dec 2003 16:36:02 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Dec 04 17:36:00 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARwSO-00044P-00 for ; Thu, 04 Dec 2003 17:36:00 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARwSN-0001h5-00 for ; Thu, 04 Dec 2003 17:35:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ARxPN-0002x1-QB for emacs-devel@quimby.gnus.org; Thu, 04 Dec 2003 12:36:57 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ARxKP-0001Ut-1T for emacs-devel@gnu.org; Thu, 04 Dec 2003 12:31:49 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ARxIc-0000xa-6c for emacs-devel@gnu.org; Thu, 04 Dec 2003 12:30:29 -0500 Original-Received: from [80.168.153.201] (helo=tf1.tapsellferrier.co.uk) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ARxGq-0008T0-HR for emacs-devel@gnu.org; Thu, 04 Dec 2003 12:28:08 -0500 Original-Received: from [80.168.156.74] (helo=kanga.tapsellferrier.co.uk) by tf1.tapsellferrier.co.uk with esmtp (Exim 3.35 #1 (Debian)) id 1ARwJ5-0002ip-00; Thu, 04 Dec 2003 16:26:23 +0000 Original-Received: from localhost ([127.0.0.1] helo=kanga.tapsellferrier.co.uk ident=nferrier) by kanga.tapsellferrier.co.uk with esmtp (Exim 3.35 #1 (Debian)) id 1ARwIz-0002QJ-00; Thu, 04 Dec 2003 16:26:17 +0000 Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: <87ptf4zib0.fsf@kanga.tapsellferrier.co.uk> Original-Lines: 30 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18381 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18381 Nic Ferrier writes: > Hmmm... maybe if most of the threading issues are with socket > communication then better sentinels would be a good idea. Maybe a > callback API for setting up and reading/writing to sockets would > really useful. Such an API would be a doddle to write of course. Doh! Elisp 21 already has non-blocking sockets... I don't remember them from the last time I did any socket stuff but they are there. So one big win would be to convert as much network reliant code to using non-blocking sockets which someone already said. Since 'open-network-stream-nowait' returns nil when it's not supported it seems fairly safe to add it to all networking code. Maybe a new form is needed: open-network-stream-nowait-if-possible which does an nbio connection if it can but otherwise a normal one. If your system doesn't support nbio then you'll still have to wait for Emacs threads for faster network connections /8-> Nic