Re: I can't create thread more than 256 on Redhat 9

From: David Schwartz (davids_at_webmaster.com)
Date: 01/08/04


Date: Thu, 8 Jan 2004 13:25:06 -0800


"David Konerding" <dek@compbio.berkeley.edu> wrote in message
news:slrnbvr24j.g9a.dek@pink.Berkeley.EDU...

>> Yes, using threads would be more efficient than forking hundreds of
>> processes. But that doesn't mean using hundreds of threads! The advantage
>> of
>> threads is that they share file descriptors, so any given thread can do
>> I/O
>> for any client. So you don't need one thread for each client, you only
>> need
>> one thread for each task you can usefully do/pend at the same time.

> It's possible to share file descriptions through processes using the Unix
> IPC mechanism (or something like it- it's in Stevens).

    Yes, but nobody has yet managed to make this work efficiently. There
aren't any practical 'process pool' servers that use a pool of processes the
same way a thread pool server uses a pool of threads. (At least, not so far
as I know.)

    It's possible in theory, of course. And some have argued that such
servers could offer significant advantages over thread pool servers. The
main problem is that unless you keep all the structures associated with a
client connection in progress in shared memory, it's not possible for an
arbitrary process to handle an arbitrary connection.

    My original statement is a bit imprecise. It's not just the difficulty
of sharing file descriptors but it's also the difficulty of managing client
state across a pool of processes simply because shared memory among
processes is awkward. To have more processes than clients, you'd have to
have more than one process that could pick up a given connection, which
would mean keeping all the information needed to handle that client in
shared memory, which would mean locks, which tend to be slow between
processes.

    DS



Relevant Pages

  • Re: Limit number of COM+ sessions
    ... I changed the Max Pool size to 1 through the Component Services ... own (the client) process. ... You configure your component to run as Server or as Library by applying the ... Only Server types can be pooled, object pooling can be configured by ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Thread info
    ... > client, now when I close the applet and open another one it creates the ... is common practice for a server to have a thread pool. ... a thread is selected from the pool to service that client. ... Is there a reason you need a continuous connection and that a request-based ...
    (comp.lang.java.programmer)
  • Re: COM+ object not being released back to the pool
    ... > are exposing the interface methods, ... > Now in my mc++ winform client, ... Now when the object reference gets released, ... If you want the object to get released to the pool deterministically, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Application Flow / security issues
    ... impersonation and makes it possible for the server process to access remote ... resources while acting as the client." ... because i assume the root of this problem is the application pool. ... You can set impersonation in the web.config. ...
    (microsoft.public.dotnet.framework.aspnet.security)