From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.user Subject: Threads and asyncs Date: 02 Sep 2002 22:52:13 +0200 Sender: guile-user-admin@gnu.org Message-ID: <40127.8439131149$1030999898@news.gmane.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1030999898 19339 127.0.0.1 (2 Sep 2002 20:51:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 2 Sep 2002 20:51:38 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17lyAa-00051g-00 for ; Mon, 02 Sep 2002 22:51:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17lyC5-0007uk-00; Mon, 02 Sep 2002 16:53:09 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17lyB7-0007sB-00 for guile-user@gnu.org; Mon, 02 Sep 2002 16:52:09 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17lyB3-0007rX-00 for guile-user@gnu.org; Mon, 02 Sep 2002 16:52:07 -0400 Original-Received: from dialin.speedway42.dip21.dokom.de ([195.138.42.21] helo=zagadka.ping.de) by monty-python.gnu.org with smtp (Exim 4.10) id 17lyB2-0007rM-00 for guile-user@gnu.org; Mon, 02 Sep 2002 16:52:05 -0400 Original-Received: (qmail 12612 invoked by uid 1000); 2 Sep 2002 20:52:13 -0000 Original-To: guile-devel@gnu.org, guile-user@gnu.org Original-Lines: 37 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.user:891 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:891 Hi, currently, when you mark a system-async, it is run at the next 'safe' point. This does not take the current thread into account and thus, you can not have thread-specific system-asyncs. One example where you might want to have a thread-specific async is when you want to interrupt the computation in a certain thread, the way you can now interrupt the repl via C-c. I would like to specify explicitely that marking a system-async will run its thunk in the thread that did the marking. That should not be a large change since the next safe point will most likely occur before the next thread switch. Also, I'd like to add a function that marks a system-async for a specified thread. The async would run at the next safe point in that thread. The implementation can be changed from a global list of system-asyncs, each with a mark, to a per-thread list of marked system-asyncs. Marking a system-asnyc for a thread would add that system-async to the thread's lists. SCM_ASYNC_TICK would check whether the current thread's list is non-empty. Also, a thread would wake up when it is blocked and run its asyncs anyway. 'sigaction' can be extended to allow marking of an async for a specified thread. With this change, an async would simply be a thunk. We could just use the thunk directly and deprecate the async abstraction. OK? (Non-system asyncs would not be affected.) -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user