On Fri, Jul 11, 2003 at 03:04:18PM -0700, Damon Hastings wrote:
This is probably a stupid question, but how do you do line-oriented blocking
socket reads in Pth? There's a pth_read() which I assume blocks until a
specified number of bytes (or eof) are received -- but I'm looking for
On Mon, Jul 14, 2003, Damon Hastings wrote:
Can you give me a ballpark idea of the cost per
context switch for 150 threads, almost all of which are waiting on I/O at
any given time?
The costs depend on the particular method Pth uses for the context
implementation, of course. But all available
The costs depend on the particular method Pth uses for the context
implementation, of course. But all available methods Pth uses are very
cheap, because they are user-space only methods. Keep also in mind that
because Pth is a non-preemtive threading implementation, the context
If the context-switching overhead turns out to be too high, then I will do
exactly that. But it will mean maintaining state for each connection, and
that state will only grow more complex with future enhancements by myself
and others.
Umm, huh?! If you don't maintain state for each
On Sun, Jul 13, 2003, Damon Hastings wrote:
[...]
So it copies the old stack out and the new stack in during every context
switch? I don't know much about thread implementation, but I guess I
thought you could just swap out the stack pointer instead of copying the
whole stack.
[...]
Sure,
On Sun, Jul 13, 2003, Damon Hastings wrote:
[...]
See the file test_common.c in the Pth source tree. It provides a
pth_readline() function (just a small but sufficient buffered wrapper
around pth_read()) which should do exactly what you want.
It looks like pth_readline_ev() reads a fixed
--- Ralf S. Engelschall [EMAIL PROTECTED] wrote:
On Sun, Jul 13, 2003, Damon Hastings wrote:
[...]
See the file test_common.c in the Pth source tree. It provides a
pth_readline() function (just a small but sufficient buffered wrapper
around pth_read()) which should do exactly what
Ah, well, I meant that a state machine must store state
explicitly, whereas
with threaded code the state is implied in the code flow (in effect, the
thread system itself is a state machine.) If each thread
executes a simple
function like void foo() {A; B; C;}, then the equivalent state
--- David Schwartz [EMAIL PROTECTED] wrote:
Ah, well, I meant that a state machine must store state
explicitly, whereas
with threaded code the state is implied in the code flow (in effect, the
thread system itself is a state machine.) If each thread
executes a simple
function like
On Fri, Jul 11, 2003, Damon Hastings wrote:
This is probably a stupid question, but how do you do line-oriented blocking
socket reads in Pth? There's a pth_read() which I assume blocks until a
specified number of bytes (or eof) are received -- but I'm looking for
something like pth_gets() to
--- Ralf S. Engelschall [EMAIL PROTECTED] wrote:
On Fri, Jul 11, 2003, Damon Hastings wrote:
This is probably a stupid question, but how do you do line-oriented
blocking
socket reads in Pth? There's a pth_read() which I assume blocks until a
specified number of bytes (or eof) are
On Sun, Jul 13, 2003 at 05:41:14PM -0700, Damon Hastings wrote:
If the context-switching overhead turns out to be too high, then I will do
exactly that. But it will mean maintaining state for each connection, and
that state will only grow more complex with future enhancements by myself
and
12 matches
Mail list logo