On Fri, Apr 11, 2008 at 02:11:30PM -0700, Tom Jackson wrote:

> 2. The thread/shared memory/synchonization model is much better than C#, VB 
> or 
> Python, and is actually well documented because it is based upon the pthreads 
> API (But it is also essentially mostly invisible at the application level). A 
> Java 5 threads API, finally introduced some features that AOLserver has had 
> for 'ever':
> 
> http://java.sun.com/j2se/1.5.0/docs/guide/concurrency/overview.html
> 
> It is hard to say if these newer languages (C# and MONO) have these features, 
> probably VB and Python don't:

Btw, I was flipping through this book the other night, and I noticed
its chapter 30, "Threads and States".

  
http://www.amazon.com/Programming-Lua-Second-Roberto-Ierusalimschy/dp/8590379825/
  Programming in Lua, Second Edition, by Roberto Ierusalimschy

Lua has "states", which are sounds equivalent to Tcl "interps", and
"threads", which are lightweight cooperative non-concurrent
user-threads, normally used only to support Lua's coroutines.
Standard Lua runs in one OS thread only, but appears to be totally
thread safe.

That chapter basically walks through a simple example of how to take
Lua "states" and "threads", plus the usual POSIX pthreads C API, and
construct a system for running concurrent lightweight Lua processes on
multiple OS threads.  He never mentions it (and may have been more
inspired by Erlang), but that sounds exactly like the "apartment
model" of threading that Tcl and AOLserver have had for years and
years.  (At least 10 years now, probably more?  I don't really know.)

Note, Lua does not actually include this lightweight-process /
apartment-threading support at all, but I thought it was interesting
that making it work like Tcl appears so straightforward.

Ierusalimschy also has a recent paper that seems to give a pretty nice
overview of concerns when designing embedable and extensible scripting
languages:

  http://www.inf.puc-rio.br/%7Eroberto/docs/jucs-c-apis.pdf
  Hisham Muhammad and Roberto Ierusalimschy. C APIs in extension and
  extensible languages. In XI Brazilian Symposium on Programming
  Languages, Natal, May 2007. (to appear)

Unfortunately, although he compares and contrasts Lua to Perl, Python,
and Ruby, he barely mentions Tcl at all.  That may explain why he
didn't notice that Chapter 30 of his book basically recapitulates
Tcl's Threading design...

(Btw, I have never actually used the language, just read about it, but
Lua's big weakness appears to be its relative dearth of standard
libraries.)

-- 
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to