[Ecls-list] separate environments for threads

Dean O'Connor dean.oconnor at ite.com.au
Tue Jun 26 04:30:47 UTC 2007


Dustin,

I get the same thing on XP aswell with latest CVS build.

I think you're answer may lie in these responses (attached) from Juanjo 
(from the archive).

cheers
deano

Dustin Long wrote:
> Has anyone ever used ECL threads much, to the extent that they could see 
> separate environments for each thread? I'm running this code sample:
>
> (defun demo-envs ()
>   (let (p q)
>     (setf p (mp:make-process))
>     (setf q (mp:make-process))
>     (mp:process-preset p
>                        (lambda ()
>                          (eval '(progn (defvar x 1)
>                                        (dotimes (i 1000)
>                                          (format t "A ~s ~s~%" x i))))))
>     (mp:process-preset q
>                        (lambda ()
>                          (eval '(progn (defvar x 2)
>                                        (dotimes (i 1000)
>                                          (format t "B ~s ~s~%" x i))))))
>     (mp:process-enable p)
>     (mp:process-enable q)))
>
> And I thought that it should yield a series of "A 1 ..." and "B 2 ..." 
> printouts, but instead I'm seeing "A 1 ..." and "B 1 ...". I was under 
> the impression that x should be distinct in p and q because it is 
> defined in that thread's environment, but it looks like it's being 
> defined globally instead. What am I doing wrong here? Problem appears in 
> both WinXP and Ubuntu.
>
> Dustin
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Ecls-list mailing list
> Ecls-list at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list
>   
-------------- next part --------------
An embedded message was scrubbed...
From: Juan Jose Garcia Ripoll <lisp at arrakis.es>
Subject: Re: [Ecls-list] Multithreaded globals
Date: Mon, 07 Nov 2005 14:06:10 +0100
Size: 5237
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20070626/0df7a63b/attachment.mht>
-------------- next part --------------
An embedded message was scrubbed...
From: Juan Jose Garcia Ripoll <lisp at arrakis.es>
Subject: Re: [Ecls-list] Multithreaded globals
Date: Mon, 07 Nov 2005 14:57:48 +0100
Size: 4949
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20070626/0df7a63b/attachment-0001.mht>


More information about the ecl-devel mailing list