On Fri, Nov 7, 2008 at 12:25 AM, cwyang <[EMAIL PROTECTED]> wrote:

> My expectation is these:
> 1) For C10K problem (or C100K), application must not use
> native threads. Big stack size means low concurrency

Hi,

I assume you mean 'new native thread per request' is bad for CnK.
Clojure's thread-pooling is not very different from the N:M threading
model that Erlang-OTP/Yaws uses, in a general sense.

> 4) At the same time, there must be ways for connecting conceptual
> gap between 2) and 3). In other words, the way for suspending current
> execution of function, saving current execution snapshot
> (normally native thread stack, but may be different),
> and switching to other functions are needed when the request for I/O
> should be blocked. It's important that the size of current execution
> snapshot should be small, since it determine the degree of
> concurrency.

Sounds like you're looking for first-class continuations here.You
won't find that on any JVM language, there's no JVM support for them.
(It is true that JVM-based Scheme languages have continuations, but
they are severely limited by the constraints of the JVM).

If you really believe you need this, you might be interested in
Termite, an Erlang-style actor system written for Gambit Scheme (which
has serializable first-class continuations and very lightweight
threads, but no SMP support if I remember correctly).

An alternative would be to use non-blocking I/O multiplexing -- an
event-driven model like you would write with select() or epoll(). I
don't know the Java universe very well, but I know JVM has
asynchronous I/O, so this must be an available option. Writing such
programs can sometimes lead to hard-to-understand, fragmented
application code, but Clojure's flexible syntax might be able to help
"unify" the fragments into a more readable form.

Best,
Graham

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to