emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threads in emacs implementation


From: Ted Zlatanov
Subject: Re: Threads in emacs implementation
Date: Wed, 15 Jun 2005 11:59:08 -0400
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.3.50 (gnu/linux)

On Sat, 11 Jun 2005, address@hidden wrote:

>     I think an alternate solution is to have no shared variables between
>     threads once they are forked, and communicate through standard IPC
>     (pipes, semaphores, etc.).
> 
> This is not possible with shallow binding.  All Lisp programs
> use the same set of symbols, and each symbol has a value.
> Many symbols' values have important standard meanings.

I'm not sure I understand the problem.  Do you mean that if a user
changes variable A in thread 1, he expects thread 2 to also notice the
change for certain global variables?  That's easy to do, if you
consider that such global variables are few and far between compared
to local per-thread variables.  defvar and similar could just be
allowed to make a variable :global, and then any change in any thread
would be propagated to the other threads by the VM.

I realize this is extra work for the programmers.  Multithreading is
never free, but the advantages are significant as well.

Ted





reply via email to

[Prev in Thread] Current Thread [Next in Thread]