>>>>> "Brian" == Brian D Carlstrom <bdc@zurich.ai.mit.edu> writes:
Brian> Michael Sperber [Mr. Preprocessor] writes:
>> No. The way Richard has solved this is by allocating a separate VM to
>> each real processor. The thread representation basically stays the
>> way it is. Saying that Scheme 48 threads "aren't real" is merely a
>> confusion of terminology.
Brian> Wow, that sounds non-portable.
Huh? It sounds about as unportable as anything else dealing with
C-level threads.
>> Any application that does this will only become slower because of it.
Brian> I'm not sure of the rationale behind this statement. Any application
Brian> that tries to use what I call a "thread per client" model ends up
Brian> drowning in both application contention issues, or external ones such as
Brian> database connections. especially in online transaction processing apps,
Brian> you really need to design your concurrency model, deciding how many
Brian> resources to dedicate to each type of transaction, how to limit
Brian> concurrency in certain places to remove contention etc.
Sure.
Brian> just throwing a 1000 threads at the problem only bogs down such
Brian> systems.
Erh, sure. You're not at all responding to what I said.
At the implementation level, the thread system takes care of calling
select for you; you can't have blocking I/O in the communication with
the host OS because that would preclude preemption. The thread system
takes care of suspending and resuming jobs that are waiting for I/O to
complete. Since this is fairly low-level, and because the thread
representation is as small as it is, this is fast. *Emulating* select
on top of that system just adds an additional layer.
A 1000 threads per se are not the issue---in principle, the
implementation can cope easily with that those kinds of numbers. Now,
sure you want to do resource management, and for that, the system
provides ample help: for example, scheduling is completely
configurable.
Of course, this is about as theoretical a discussion as it gets.
Should we find out that somebody want to implement some gigantic
server app using scsh and really need select, we (or someone else who
supposedly knows how to do it right and efficiently) can still
implement it. Martin's question was about the present, not about some
hypothetical future.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
|