From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,2c15cd92dd7e3b61 X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1994-04-04 05:31:30 PST Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!gatech!taco.cc.ncsu.edu!adm!mauney From: mauney@adm.csc.ncsu.edu (Jon Mauney) Newsgroups: comp.unix.osf.misc Subject: Re: DCE Client/Server Exceptions Date: 4 Apr 94 12:31:30 GMT Organization: North Carolina State University Message-ID: References: <1994Apr3.144347.27715@cgh.cgh.com> NNTP-Posting-Host: adm.csc.ncsu.edu Keywords: dce rpc osf client server 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"