emacs-devel
[Top][All Lists]
Advanced

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

Re: Multithreading, again and again


From: SAKURAI Masashi
Subject: Re: Multithreading, again and again
Date: Thu, 20 Oct 2011 10:12:13 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/23.3 Mule/6.0 (HANACHIRUSATO)

Hi,

> on Wed Oct 19 2011, Tom Tromey <tromey-AT-redhat.com> wrote:
> 
> > [ threading ]
> >
> > Stefan> We could provide a `fork' primitive, indeed.
> >  :
> Again, I think some beautiful and usable library code could make this
> approach much more attractive and more widely used.  Emacs IPC anyone?

Now, I'm writing async rpc stack between Emacs and other programs
(including Emacs).  In last week, I showed a demo at YAPC::Asia 2011
at Tokyo. I'm going to show the code soon.


Well,
I think implementation of multithreading in Emacs is SO difficult to
add a threading feature after the language implementation. I think it
should be done at the language design level.

Actually, many scripting language could not get true concurrency by
the appended thread feature, such as Perl's ithread, ruby's thread,
python's one and so on. They have the GIL problem.

Ref:
  The Global Interpreter Lock and Ruby / Python concurrency | Merbist
  http://merbist.com/2011/10/03/about-concurrency-and-the-gil/

  AnyEvent, Coro, IO::AIO - a good team by Marc Lehmann (mlehmann)
  http://yapcasia.org/2011/slides/mlehmann/

Multi-threading and GUI is very sensitive topic. 

  Multithreaded toolkits: A failed dream? | Java.net
  http://weblogs.java.net/blog/kgh/archive/2004/10/multithreaded_t.html

I think this problem exists in Emacs too.


I wrote deferred.el and concurrent.el for non-preemptive threading
(Event model) in Emacs, as JavaScript's Deferred and Perl's AnyEvent
do. This elisp can retrieve some remote resources in parallel and wait
for them asynchronously. Although this implementation (deferred.el and
concurrent.el) may not be the best, I think this approach may be the
best approach to get the concurrency in Emacs.


--
SAKURAI, Masashi (family, given)
address@hidden



reply via email to

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