Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: mauney@adm.csc.ncsu.edu (Jon Mauney)
Subject: Re: DCE Client/Server Exceptions
Date: 4 Apr 94 12:31:30 GMT	[thread overview]
Message-ID: <mauney.765462690@adm> (raw)
In-Reply-To: 1994Apr3.144347.27715@cgh.cgh.com

paul@cgh.cgh.com (Paul Homchick) writes:

>I am working on a DCE/RPC application that, strangely enough, has one
>client and multiple servers.  The servers are multi-threaded with one
>section of code that talks to another application using sockets.  This
>section of code cannot be interrupted, and must complete or dire
>things happen.  Thus, when this section of code is entered, all other
>threads are blocked.

>My problem is that when a client dies unexpectedly, the server thread
>also seems to die.

Let me restate the situation, to make sure I understand the key points:
   Your server accepts a client request, and as part of the server
   code makes a connection to another application.  This socket
   operation must complete, even if the client process dies in
   the interval.
First, you need to understand the DCE model of multi-threaded RPC:
The thread operating in the server is considered to be an extension
of the thread operating in the client.  For example, if the client
passes invalid arguments to an RPC and the server gets a segmentation
violation as a result, the exception is reported back to the client,
and the client core-dumps, not the server.
In this model, it is reasonable to expect that the death of a client
would be reported to the server.

If you want to make sure your non-RPC connection completes,
I would create a separated thread in the server to do this operation,
before entering rpc_server_listen().  Server threads could
send work to this thread and wait for it to finish; if a server thread
dies, the other connection is not affected. Any mutexes required
could be held by the extra thread, so they can be easily cleaned up;
use of a separate thread may reduce the need for mutexes, anyway.
-- 
Jon Mauney 			 mauney@csc.ncsu.edu
Mauney Computer Consulting	 (919) 828-8053

	"Have TGT, will travel"


  reply	other threads:[~1994-04-04 12:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-04-03 14:43 DCE Client/Server Exceptions Paul Homchick
1994-04-04 12:31 ` Jon Mauney [this message]
1994-04-04 13:28 ` Rich Salz
1994-04-04 18:29   ` Seiichi Tatsukawa
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox