From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 13 21:32:56 2017 Received: (at submit) by debbugs.gnu.org; 14 Dec 2017 02:32:56 +0000 Received: from localhost ([127.0.0.1]:32847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePJKR-0001ao-77 for submit@debbugs.gnu.org; Wed, 13 Dec 2017 21:32:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58221) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePITJ-00005d-Ar for submit@debbugs.gnu.org; Wed, 13 Dec 2017 20:38:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePITD-0006zf-27 for submit@debbugs.gnu.org; Wed, 13 Dec 2017 20:37:56 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48424) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePITC-0006zT-Uv for submit@debbugs.gnu.org; Wed, 13 Dec 2017 20:37:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePITB-00037e-LV for bug-guile@gnu.org; Wed, 13 Dec 2017 20:37:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePIT6-0006vR-OZ for bug-guile@gnu.org; Wed, 13 Dec 2017 20:37:53 -0500 Received: from mail-pg0-x22f.google.com ([2607:f8b0:400e:c05::22f]:34478) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePIT6-0006uh-IE for bug-guile@gnu.org; Wed, 13 Dec 2017 20:37:48 -0500 Received: by mail-pg0-x22f.google.com with SMTP id j4so2375661pgp.1 for ; Wed, 13 Dec 2017 17:37:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=nscPnkC/Om48b7OOVSkQIH6QSECicgD7poegtQIEnP0=; b=CNkDFW0l3d7TmRmAoAuQvbK2d0B2CqMJZBcA6xA87BnYzGYSvLGqhM4zYV5UABIA2n RDr5Wd7E3G5xf8mIpvizDY9lt7Qvox/VnhjybHEmHfZ2Tn/Hc5RnSuAXyx4M6kcM34x3 EhmntNzTC5bTgver2UdbBVNs/vfgvnIG349XUKlH8ETrKUrV3moHJ56uFtHQ8QPzTmYU A2uQhq6FK/ysdZJScuvRYFHwrwj6VzeEog2xnabY403yaZZeea4fCgd2reMZpCmqMa5L YhBsI997JKPwKpOmr1VvTsUfSwfMjftN/0cULLECQUHEHs3bbL+u34JcW/R2plMiL0zj 3evA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=nscPnkC/Om48b7OOVSkQIH6QSECicgD7poegtQIEnP0=; b=ROmNt8JwB3pJYeCYm1tUjrVkDuajBlbMgDnaj3RFYngV717gPW3QvmWsHckBNUcV7b gOZ/tDA4Dmyx1CqsFV6cVqJoNcEJH5/LaB4lli2HVm5uyZP7Mlwa1LBMQz1tAtz7BdKx +d7OOKoFqrIea5wB4g9rugfA7vLALkU71raw+M+9Btdsn384o+wsnDBlC/Q7gbDhb3os VZHa5jFz+mDEgA9f9i/IPPZAJT4yLPMKWkx/LT5TLHq+s8dPJ0nfACtnbcYoOHy3LBTr dV7H1o21sgnTROiLgH8cFs44wrDUvczU411Eemr4ZjUUkXx6yvR1ZJUA9amXQ9758QUV lW9g== X-Gm-Message-State: AKGB3mKzXosvYzZAjJQX64uQv+WUDqI2FwSWbgKXDF+jyuXSWzNPT3C/ Erwj0OBOQo7dctCs9wNN7TofTg== X-Google-Smtp-Source: ACJfBos9sGDWHcDCXOpTxqGal6/dhEkxwEipJZ+NBolzWdOfbosRE17Ls4xv61cvNUfGbBU8yE1I8w== X-Received: by 10.101.93.79 with SMTP id e15mr6921237pgt.157.1513215466815; Wed, 13 Dec 2017 17:37:46 -0800 (PST) Received: from [192.168.178.61] ([203.217.89.47]) by smtp.googlemail.com with ESMTPSA id t1sm4818920pgs.13.2017.12.13.17.37.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Dec 2017 17:37:45 -0800 (PST) To: bug-guile@gnu.org From: David Beswick Subject: Guile 2.2.2: SRFI-18, condition variables, timeouts Message-ID: <47bd4b8a-55fe-bc92-4a64-b8bdeba2e5d5@gmail.com> Date: Thu, 14 Dec 2017 12:37:41 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 13 Dec 2017 21:32:53 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Hello, I'm using Guile 2.2.2 built from source as downloaded from the project website. $ guile -v guile (GNU Guile) 2.2.2 I would expect the following command to return in 5 seconds: $ guile -c '(use-modules (srfi srfi-18)) (let ((cv (make-condition-variable)) (m (make-mutex))) (mutex-lock! m) (mutex-unlock! m cv 5))' However, it returns instantly for me. This command works as expected: $ guile -c "(use-modules ((srfi srfi-18) #:prefix srfi:)) (let ((cv (srfi:make-condition-variable)) (m (srfi:make-mutex))) (srfi:mutex-lock! m) (srfi:mutex-unlock! m cv (+ (current-time) 5)))" It's stated on the page https://srfi.schemers.org/srfi-18/srfi-18.html that: "All synchronization primitives which take a timeout parameter accept three types of values as a timeout, with the following meaning: * a time object represents an absolute point in time * an exact or inexact real number represents a relative time in seconds from the   moment the primitive was called * #f means that there is no timeout" Assuming this page is accurate, then the case in the test code falls under the second dot point from the spec. The source in module/srfi/srfi-18.scm seems to pass the timeout parameter unaltered to Guile's wait-condition-variable function, and that parameter is said in the docs to be "either a integer as returned by ‘current-time’ or a pair as returned by ‘gettimeofday’". I think that would cause the unexpected behaviour that I see. I have some time at the moment where I could address this, please let me know if you would like me to work on a fix. Regards, David From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 16 09:31:09 2018 Received: (at 29704-done) by debbugs.gnu.org; 16 Feb 2018 14:31:09 +0000 Received: from localhost ([127.0.0.1]:45821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emh2b-0004Qn-9X for submit@debbugs.gnu.org; Fri, 16 Feb 2018 09:31:09 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:35108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emh2Z-0004Qf-Uv for 29704-done@debbugs.gnu.org; Fri, 16 Feb 2018 09:31:08 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id E1EB2115E1; Fri, 16 Feb 2018 15:31:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E-TY8huRKCcM; Fri, 16 Feb 2018 15:31:03 +0100 (CET) Received: from ribbon (unknown [193.50.110.160]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 08BB5115AC; Fri, 16 Feb 2018 15:31:02 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: David Beswick Subject: Re: bug#29704: Guile 2.2.2: SRFI-18, condition variables, timeouts References: <47bd4b8a-55fe-bc92-4a64-b8bdeba2e5d5@gmail.com> Date: Fri, 16 Feb 2018 15:31:02 +0100 In-Reply-To: <47bd4b8a-55fe-bc92-4a64-b8bdeba2e5d5@gmail.com> (David Beswick's message of "Thu, 14 Dec 2017 12:37:41 +1100") Message-ID: <87h8qhnh09.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29704-done Cc: 29704-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hi David, David Beswick skribis: > I would expect the following command to return in 5 seconds: > $ guile -c '(use-modules (srfi srfi-18)) (let ((cv > (make-condition-variable)) (m (make-mutex))) (mutex-lock! m) > (mutex-unlock! m cv 5))' > > However, it returns instantly for me. This command works as expected: > $ guile -c "(use-modules ((srfi srfi-18) #:prefix srfi:)) (let ((cv > (srfi:make-condition-variable)) (m (srfi:make-mutex))) > (srfi:mutex-lock! m) (srfi:mutex-unlock! m cv (+ (current-time) 5)))" > > > It's stated on the page https://srfi.schemers.org/srfi-18/srfi-18.html th= at: > > "All synchronization primitives which take a timeout parameter accept thr= ee > types of values as a timeout, with the following meaning: > > * a time object represents an absolute point in time > > * an exact or inexact real number represents a relative time in > seconds from the > =C2=A0 moment the primitive was called > > * #f means that there is no timeout" > > Assuming this page is accurate, then the case in the test code > falls under the second dot point from the spec. Sorry the late reply. I believe this and a similar issue with =E2=80=98thread-sleep!=E2=80=99 is now fixed: https://git.savannah.gnu.org/cgit/guile.git/commit/?h=3Dstable-2.2&id=3D2= c7b350f93564daee16a311c001a85577d4b69e1 https://git.savannah.gnu.org/cgit/guile.git/commit/?h=3Dstable-2.2&id=3D3= 9860539599f74958c0cc9008fc6fa271349b58b Let me know if anything=E2=80=99s wrong! Thank you, Ludo=E2=80=99. From unknown Sat Jun 21 05:15:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 17 Mar 2018 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator