--- Jason Evans <[EMAIL PROTECTED]> wrote: > 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 others. The big draw to Pth for me is the simplicity of threaded > code > > with the efficiency of a state machine. At least, I think it will be > > efficient. I don't actually know at this point exactly how expensive a > > context-switch in Pth is. > > Keep in mind that each thread still has its own stack, which can be a lot > of overhead as the number of threads grows. You mentioned connection > state > complexity rather than size, so maybe this isn't a concern for you.
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. It's good that you guys tell me these things during the planning stage -- I guess that's an argument for using heap allocation instead of stack allocation, eh? __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com ______________________________________________________________________ GNU Portable Threads (Pth) http://www.gnu.org/software/pth/ Development Site http://www.ossp.org/pkg/lib/pth/ Distribution Files ftp://ftp.gnu.org/gnu/pth/ Distribution Snapshots ftp://ftp.ossp.org/pkg/lib/pth/ User Support Mailing List [EMAIL PROTECTED] Automated List Manager (Majordomo) [EMAIL PROTECTED]