[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: call/cc
You write:
> Here's the single most practical reason why I love call/cc: Web
> application servers et filia.
>
> - NThreads > CPUParallelism is a bad condition for high performance IO
> systems. Examples abound in which naively implemented fully
> asynchronous I/O engines beat the pants off of highly tuned
> multithreaded servers, up to the limit of 1 CPU.
I don't quite understand the connection. What are you counting as
"threads" in your NThreads? Are you counting captured continuations
that will be resumed later, or not? How about other user-level thread
packages that don't require a round trip into and out of the kernel for
each context switch?
While I've written some of the examples you mention myself, I don't
really know where the extra CPU time goes in multithreaded systems.
I think your (later) point about threads being harder to maintain is
debatable; writing complex asynchronous code (without call/cc, that is)
forces your program into explicit CPS, which is a major pain.