[E-Lang] motivations for multithreading: external interfaces, SMP/SMT, UI

zooko@zooko.com zooko@zooko.com
Sat, 21 Jul 2001 11:10:12 -0700


There are three reasons that I can think of that motivate people to use
pre-emptive multithreading:

1.  Interfaces to external devices e.g. networks, peripherals, hard drive.
2.  Taking advantage of symmetric multiprocessor machines.
3.  More responsive user interfaces.


 --- External Devices

This we've already begun discussing in recent discussion on e-lang.


 --- Symmetric Multiprocessing

This seems important to me, and promises to become more important if "symmetric
multi-threading" CPU architecture fulfills its promise to be the next big thing
in CPU design.  (Hopefully Jonathan or someone else with deeper CPU-fu than
mine could say something about this.)

This was why I wrote an article for e-lang entitled "transparent
parallelism"[1].  To summarize: we can take advantage of symmetric
multiprocessing/symmetric multithreading without breaking the rules of
event-based concurrency and without otherwise surprising the programmer.
Unfortunately to do so would be complicated to implement and would not take
advantage of multiple processing units as efficiently as pre-emptive
multithreading would.

(There is also a follow-up article [2] from Felix Croes, who was at the time
implementing such a system.  It is a good article, but keep in mind as you read
it that Felix made two mistakes therein: first, he didn't realize that his and
my explanations of transparent parallelism for event-based programming were
actually describing the same technique in different terminology, and second he
didn't realize that E is strictly event-based just as his own system is.)


 --- User Interface

I haven't seen this mentioned yet, but I know that E is intended to interact
closely with user interfaces.  Conventional wisdom has it that minimizing the
latency between a user's act and its response is very important.  "Sluggish" or
"unresponsive" UI is widely decried.

I'm looking forward to seeing how E programs handle user interface performance
issues.


Regards,

Zooko

[1] http://www.eros-os.org/pipermail/e-lang/2001-April/005003.html
[2] http://www.eros-os.org/pipermail/e-lang/2001-April/005033.html