From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.user Subject: Re: libguile thread safety Date: Sat, 4 Jan 2014 17:16:55 +0000 Message-ID: <20140104171655.3df648d5@bother.homenet> References: <20140103233407.36382e5f@bother.homenet> <8738l41p8r.fsf@netris.org> <20140104124459.6c604ae1@bother.homenet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1388855838 1643 80.91.229.3 (4 Jan 2014 17:17:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Jan 2014 17:17:18 +0000 (UTC) Cc: "guile-user@gnu.org" To: Panicz Maciej Godek Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jan 04 18:17:25 2014 Return-path: Envelope-to: guile-user@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 1VzUqi-00029v-5V for guile-user@m.gmane.org; Sat, 04 Jan 2014 18:17:24 +0100 Original-Received: from localhost ([::1]:55221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzUqh-00011w-MV for guile-user@m.gmane.org; Sat, 04 Jan 2014 12:17:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzUqN-0000qF-E0 for guile-user@gnu.org; Sat, 04 Jan 2014 12:17:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzUqE-0006Bn-3D for guile-user@gnu.org; Sat, 04 Jan 2014 12:17:03 -0500 Original-Received: from smtpout2.wanadoo.co.uk ([80.12.242.42]:22475 helo=smtpout.wanadoo.co.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzUqD-0006BO-St for guile-user@gnu.org; Sat, 04 Jan 2014 12:16:54 -0500 Original-Received: from bother.homenet ([95.146.112.60]) by mwinf5d30 with ME id 9tGr1n00D1JEVaP03tGrDv; Sat, 04 Jan 2014 18:16:52 +0100 Original-Received: from bother.homenet (localhost [127.0.0.1]) by bother.homenet (Postfix) with ESMTP id AC6ED88504; Sat, 4 Jan 2014 17:16:55 +0000 (GMT) In-Reply-To: X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.22; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.12.242.42 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10974 Archived-At: On Sat, 4 Jan 2014 16:01:35 +0100 Panicz Maciej Godek wrote: [snip] > It indeed does seem that the threads share their top-level bindings on > guile's side, and I suppose that this is the intended behaviour. I > think that it can be easily adjusted with scm_eval_string_in_module, > i.e. if you provide a separate module for each thread. Ye gods. Your suggestion seems the way to go. However, having a separate module for each thread is not really a runner with a thread pool. Instead of doing this on a thread-by-thread basis, it would instead be necessary to create a new module on the fly for each task. Most variables could of course be wrapped in an overarching lambda or let expression encapsulating the task, but there will still be some top level variables to be exported to the task that the code will need to see. Is there any procedure to obtain a unique random name in guile? Chris