[omniORB] more Questions about oneway and asynchronous messages...

Bruce Visscher visschb@rjrt.com
Wed, 07 Jul 1999 15:40:03 -0400



Rusty Carruth wrote:

> >
> > OTOH, unless you try this, you don't know that it's worse performance.
> > Spawning a thread should be low overhead.  We have found that changing one-way
> > calls to non-one way does not effect performance (in our applications) as much
> > as might be expected.
> >
>
> The only thing that might surprise you is memory usage when you spawn
> a thread (suprise if and only if you've not paused a bit to think about
> it ;-).
>
> On Solaris, you get something like 1meg of stack space allocated
> (I think its virtual and not actually USED until you use enough
> to need another chunk).  So if you spawn 100 threads and don't
> tell the OS to allocate a different stack (and so forth) space
> then you've just burned 100 meg....  Its obviously a good idea
> to try to not need 1 meg per thread, in this case, unless you
> (like us) have LOTS of memory (well, ok what USED to be
> considered lots of memory - 750 meg ;-)

You're right, of course.  I guess I was too flipant.  I think what I would do in a
situation like this would be to create a single thread (or a thread per client) and
queue up the messages.  Using std::queue and a condition variable makes this pretty
easy work.