From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: wip-threads-and-fork Date: Sun, 08 Apr 2012 00:54:57 +0200 Message-ID: <87k41ri24e.fsf@gnu.org> References: <877gzx0ye0.fsf@pobox.com> <878vjupmw7.fsf@pobox.com> <87ipixoajf.fsf@pobox.com> <87sjhx1cii.fsf@gnu.org> <87r4xg8vk0.fsf@pobox.com> <87boog6rnm.fsf@inria.fr> <87mx7xd4s0.fsf@pobox.com> <8762el5qkx.fsf@gnu.org> <87zkbwa95w.fsf@pobox.com> <8762dx7iiz.fsf@gnu.org> <87k42bmz9j.fsf@pobox.com> <874ntayr81.fsf@gnu.org> <87d37klnm2.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1333839308 3031 80.91.229.3 (7 Apr 2012 22:55:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 7 Apr 2012 22:55:08 +0000 (UTC) Cc: guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Apr 08 00:55:08 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SGeXD-0007Fh-TT for guile-devel@m.gmane.org; Sun, 08 Apr 2012 00:55:08 +0200 Original-Received: from localhost ([::1]:35206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGeXD-00057q-Aq for guile-devel@m.gmane.org; Sat, 07 Apr 2012 18:55:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGeXA-00051S-Vd for guile-devel@gnu.org; Sat, 07 Apr 2012 18:55:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SGeX7-00050n-Ve for guile-devel@gnu.org; Sat, 07 Apr 2012 18:55:04 -0400 Original-Received: from xanadu.aquilenet.fr ([88.191.123.111]:60249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGeX7-0004yH-Q0 for guile-devel@gnu.org; Sat, 07 Apr 2012 18:55:01 -0400 Original-Received: from localhost (xanadu.aquilenet.fr [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id 5DC9E6EFD; Sun, 8 Apr 2012 00:54:59 +0200 (CEST) Original-Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VLwr8+raIUVD; Sun, 8 Apr 2012 00:54:59 +0200 (CEST) Original-Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id 9E1EC2741; Sun, 8 Apr 2012 00:54:58 +0200 (CEST) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 Germinal an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87d37klnm2.fsf@pobox.com> (Andy Wingo's message of "Fri, 06 Apr 2012 11:30:13 -0700") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 88.191.123.111 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:14227 Archived-At: Hey! Andy Wingo skribis: > On Tue 27 Mar 2012 08:54, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Andy Wingo skribis: >> >>> On Wed 21 Mar 2012 22:26, ludo@gnu.org (Ludovic Court=C3=A8s) writes: >>> >>>> What about adding a big fat warning in the doc about use of >>>> =E2=80=98primitive-fork=E2=80=99 in a multi-threaded program? >>> >>> Sure. WDYT about a warning at runtime as well? (I assume you still >>> don't like the current master behavior of throwing an exception if other >>> threads are running?) >> >> I agree that =E2=80=98primitive-fork=E2=80=99 has a number of important = shortcomings. >> I=E2=80=99m not convinced that anything needs to be done in the code its= elf, >> though. It=E2=80=99s just as harmful as =E2=80=98pointer->procedure=E2= =80=99, in a way. > > Indeed. One more point though, not to totally drive this discussion > into the ground: primitive-fork is unlike pointer->procedure in that its > correctness depends on global conditions rather than local conditions. > > If I load up a library and dlsym an address, and I believe that the > library has some kind of interface stability, then using > pointer->procedure is correct -- independent of what other Guile modules > are doing. > > Whereas, the correctness of using primitive-fork in a module depends on > what other modules do. Even if your module that uses primitive-fork > doesn't interact with anything else, it suddenly becomes incorrect if > the user loads up some threads-using library, like an asynchronous DNS > resolver implemented using getaddrinfo and thread-pools. Right. > If other threads are active, I think primitive-fork should raise an > error. But if you think warnings are the way to go, I'm OK with that > too. Do you still think warnings are the right answer? I think so, and with a caveat in the manual. Thanks for your patience. :-) Ludo=E2=80=99.