From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.user Subject: RE: Question about handling SIGINT properly in Guile Date: Mon, 15 Apr 2024 00:50:30 +0200 Message-ID: <20240415005031.BAqW2C0035DiQeu01AqXFb@laurent.telenet-ops.be> References: <87wmp1fhhj.fsf@vijaymarupudi.com> <874jc51a9f.fsf@laura> <87jzl1rp0h.fsf@vijaymarupudi.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27677"; mail-complaints-to="usenet@ciao.gmane.io" To: Vijay Marupudi , Olivier Dion , "guile-user@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Apr 15 00:56:12 2024 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rw8lg-0006xU-8f for guile-user@m.gmane-mx.org; Mon, 15 Apr 2024 00:56:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rw8lG-0002BX-Ue; Sun, 14 Apr 2024 18:55:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rw8lD-0002BN-BA for guile-user@gnu.org; Sun, 14 Apr 2024 18:55:43 -0400 Original-Received: from laurent.telenet-ops.be ([2a02:1800:110:4::f00:19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rw8lB-0000b6-0r for guile-user@gnu.org; Sun, 14 Apr 2024 18:55:43 -0400 Original-Received: from [IPv6:2a02:1808:5:b9b8:ec4d:6e69:1435:d32b] ([IPv6:2a02:1808:5:b9b8:ec4d:6e69:1435:d32b]) by laurent.telenet-ops.be with bizsmtp id BAqW2C0035DiQeu01AqXFb; Mon, 15 Apr 2024 00:50:31 +0200 Importance: normal X-Priority: 3 In-Reply-To: <87jzl1rp0h.fsf@vijaymarupudi.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=telenet.be; s=r24; t=1713135031; bh=S8A9y4ACqA31SL8qvm/L2FjjSNft9I9u6j/zkokJ3Mw=; h=To:From:Subject:Date:In-Reply-To:References; b=Ts65Dp+kIqvQgc0Q78yULlkuocOKr7yO32R3AidMba5A3TnIE7GiMvSdkfVRmw7NL ZtCyGA4zmV5wj8VM8SBYdTn4LUqMHOLn6Xc0HLEHN6+WcxVD1UWFDV0O4w1yPmTVHo vg5sEwHHPdvk71O+WY2OewM3ud9jTa64fhl7pEsoI+wdZ1Kvw8LhVfdMT8H5Re7lGV bPw0yvrzsoWovEwd/MQJcgT0bF0odqwoi3K4mczPLPUM4rcSRefUED8dRq7HGj/iPL GaYU1QzK8Y8s8yZw6NeifdvElX8A6sVnMnxgbHmJqB3yfL3HCMgqqNaapPvQnPYPLF 9qM8ivr2w+yVg== Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19518 Archived-At: Sent from Mail for Windows From: Vijay Marupudi Sent: Saturday, 13 April 2024 22:24 To: Olivier Dion; guile-user@gnu.org Subject: Re: Question about handling SIGINT properly in Guile > So there is two things with signals. First, when a process get a signal > queued, the OS only deliver the signal -- at least on linux -- when > going back to user-space. Typically, before the process get >> re-scheduled or after a system call. So sending a signal is not >> immediate. Furthermore, Guile also queues the signals and deliver them >> to threads with async marks I think. >I understand. I don't get this problem with C, so I assume it's the >asynchronity of Guile that is my issue. I tried running the >scm_async_tick function, which the documentation says runs queued asyncs >(by providing a 'safe point', but that doesn't seem to change anything. scm_async_tick is a thing for loops in C code, to make them interruptible (= in this case, in the sense that an async can be run). Somewhere in the Scheme->bytecode compiliation process, the bytecode equiva= lent to scm_async_tick is automatically inserted in various cases (I don=E2= =80=99t recall all cases, but at least this is the case in loops). =E2=80= =93 you don=E2=80=99t need to manually scm_async_tick to make it possible t= o run the async. (Barring any bugs.) (Now reading the previous e-mails ...)