apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Kenneth Casson Leighton <l...@samba-tng.org>
Subject Re: DCEthreads - cancellation / mutexes is possible
Date Tue, 17 Jul 2001 14:54:47 GMT
On Tue, Jul 17, 2001 at 06:49:20AM -0700, rbb@covalent.net wrote:
> > well, in amongst all this about threads etc. i just wanted
> > to let you know that i happened across the context_app
> > example in the dce 1.22 codebase.  it is an example
> > client and server that maintains a context - a persistent
> > connection across multiple remote function calls.
> >
> > this implies that if the connection dies without the client
> > destroying the context, then the server must do it _for_
> > you [by calling context_name_t_rundown which you *have* to
> > provide: it calls it on every outstanding context of type
> > 'context_name_t' it is an auto-generated function.]
> >
> > and that means killing a thread.
> >
> > and _that_ implies thread cancellation and cleanups.
> >
> > and it works.
> >
> > therefore, i conclude that the dce/rpc codebase has successfully
> > implemented thread cancellation in their POSIX/Draft4 thread
> > library.
> That is quite a leap in logic there.  

okay, so i'm a rutherford instead of an einstein
[rutherford was known for knowing what the answer was,
and then cooking the books to get the missing steps
between the question and the correct answer :) :)

iow, i know that dce threads have cancellation.  like
sander says, this is pretty hard-core code used in
things like the National Insurance Database, military
and government-mandated applications etc., so...

> I can think of multiple ways that
> the thread itself could timeout and kill itself.  You also haven't
> mentioned how much memory was leaked by killing that thread.  I am not
> saying you are wrong, just that with the information you provided above, I
> am not convinced that they have actually successfully implemented async
> killing of threads.

okay.  i tried a little test.

just before freeing the context, i instead call exit(0).
i presume that this is a Bad Thing To Do?  there is even
a client thread so i presume doing this sort of thing
is Not Good.

then i do this:
while 1; do ./context_client 'test message'; done;

now, this generates about... difficult to tell, the screen
scrolls so quickly... 50 clients per second, at a guess?

i left it for about a minute, and then examined the server apps
[there are 10 threads forked off].  the memory usage did NOT
change / go up.

... just tried it again [2 mins]: *giggle*.  oh dearie me:
The Open Group is going to be so pissed :)  memory usage went up
from 1584 to 1608 and now the server isn't accepting connections any more.

teehee :)

[... ah, no: it's recovered again.  hey, this is just plain odd.
okay, could just be i'm overloading my computer :) ]

yep: been running on-and-off for several minutes: ps auxw shows
no obvious memory leaks.  if you know a better way than ps axuw
please let me know!


View raw message