From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,c4fa1a2cfa0d7dda X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1993-08-13 09:24:03 PST Newsgroups: comp.unix.osf.misc Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!charon.citicorp.com!ibism!gjb From: gjb@fig.citib.com (Greg Brail) Subject: Re: DCE questions Message-ID: Keywords: DCE,RPC Sender: news@fig.citib.com Organization: Citibank IBISM References: <2361@ncrsecp.Copenhagen.NCR.COM> Date: Fri, 13 Aug 1993 15:01:07 GMT In article <2361@ncrsecp.Copenhagen.NCR.COM> pio@ncrsecp.Copenhagen.NCR.COM (Per Igel) writes: As I understand it, you want to use DCE to pass untyped streams of bytes. The server will recieve them and spit them back again. Unless your "scheduler" does something fun like set priorities and stuff, all you really need to do is write a server that accepts incoming RPCs with variable-length byte arrays in them, then calls RPCs that send them on their way. Each RPC will be transparently handled in a separate thread. The whole thing should take about 30 lines of code. Even if it's more complicated than this, I can't see what purpose DCE serves in this project, unless the point is to use it for the sake of using it. If you avoid security, naming, and even data marshalling, you might as well just use streams or sockets. Sadly, I see lots of people used to programming in the "message passing" style who learn about DCE, than start trying to use it to pass around those same untyped streams of bytes. >Initially the scheduler process will setup a signal handling routine for >SIGPOLL and create a number of TLI endpoint/connections (to the servers it >wants to connect to), then reads (blocks on) the incoming request queue (IRQ). Your implementation of DCE may not let you catch SIGPOLL. Transarc DCE for Solaris 1.1 (SunOS 4.1.3), for instance, won't let you do this. DCE vendors usually re-implement the standard libraries in a thread-safe manner. If you're lucky, your vendor re-implemented whatever standard library functions and system calls you need to work in a multithreaded environment. For instance, it'll let you call "write" in several different threads using the same file descriptor without causing too much havoc. However, lots of signals (like SIGPOLL and SIGIO) are usually unavailable to users for this reason. >I think the basic questions regarding this pilot project boils down to: > - DCE-RPC is extremely synchronous, therefore, the only way to make it > "asynchronous" is to create a thread for each RPC call you send of > or for each RPC call or each "connection", because you could do > something like regarding bindings as having the same function as > TLI file descriptors. Or are there asynchronous RPC's in DCE RPC as > there is in Sun RPC? The "maybe" qualifier, possibly combined with "idempotent", makes the RPC asynchronous. You can't return anything from the RPC, you don't have to wait for it to complete, and you have no way of knowing whether or not it worked. > - when I make the scheduler process both a client and a server then > I need to kick off the "rpc_server_listen" call in a separate thread > (for the server part), right? Now that I have a "server"-thread and > a several client threads is there a point where my process runs out > of threads?? Is 'rpc_c_listen_max_calls_default' that max limit or > what? And what if that happens how do I solve this? Spawn a thread to run the "rest" of your program, then call "rpc_server_listen" in the main thread. I've been told DCE gets unhappy on some platforms when you don't do it this way. If the maximum number of threads is busy, incoming calls go into a queue. If that fills up, RPCs fail with a communications error. greg -- Greg Brail ------------------ Citibank -------------------- gjb@fig.citib.com