Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sun-barr!newstop!eastapps!helium!db From: db@helium.East.Sun.COM (David Brownell) Newsgroups: comp.windows.x Subject: Re: X and RPC libraries: Can they co-exist? Message-ID: <4050@eastapps.East.Sun.COM> Date: 24 Jan 91 17:52:08 GMT References: <2962@hsi86.hsi.com> <62280@bbn.BBN.COM> Sender: news@East.Sun.COM Reply-To: db@east.sun.com (David Brownell) Organization: Sun Microsystems, Billerica MA Lines: 37 In article <62280@bbn.BBN.COM> fkittred@spca.bbn.com (Fletcher Kittredge) writes: > In article <2962@hsi86.hsi.com> wright@hsi86.hsi.com (Gary Wright) writes: > >Has anyone tried to integrate RPC mechanisms within the X toolkit > >event loop programming model? I am looking specifically for anyone who > >has experience with Sun's ONC system or Apollo/HP/OSF's NCS RPC mechanisms > >with any X toolkit. It doesn't seem to me to be a straight forward problem > >since both types of libraries (X & RPC) make certain assumptions about blocking > >on sockets reads and neither was designed with the other in mind. > OSF DCE comes with a threads package, which addresses this problem. > ... Sun's current thread > implementation will be of no help since it is a user space implementation > which blocks all threads if the current thread is waiting on a syscall. Don't draw the conclusion that you can't use SunRPC with X toolkits because Sun's current (4.x) LWP library isn't kernel-based; that would be wrong. SunRPC was designed with the knowledge that it would need to be integrated with other event loops; I know of several tools that talk to each other using SunRPC. Using only public interfaces -- look for documentation on custom versions of svc_run(), which is the primary server side component to block -- it's easy to have X applications act as SunRPC servers, so that incoming RPC requests are dispatched just like incoming X protocol messages are. Blocking as an RPC client can usually be minimized or even avoided; otherwise, it's just another case where an X application needs to disable input temporarily. The current XView sources already have that server side support, if you request it by calling notify_enable_rpc_svc(TRUE). It's not tough to do the same with raw Xlib or intrinsics, either, but does require grokking both toolkit and SunRPC documentation. There's no need to wait for a new networking or OS framework unless you really want to. - Dave One of the Million monkeys ... see, here's my keyboard!