Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mandrill!gatech!bbn!milliken@bbn.com From: milliken@bbn.com (Walter Milliken) Newsgroups: comp.windows.x Subject: X11 and multiple processes Summary: Does X work with multiprocessor programs? Message-ID: <25516@bbn.COM> Date: 8 Jun 88 18:20:01 GMT Sender: news@bbn.COM Reply-To: milliken@bbn.com (Walter Milliken) Organization: BBN Advanced Computers, Inc. Lines: 37 I was hoping one of the X gurus out there might be able to help me with a possible problem: I have a (hypothetical) program which consists of many (possibly a hundred or more) Unix processes. Each of these processes would like to do output to the X server. All are children of a single process. I can see two possible ways of handling this: 1) The original process calls XOpenDisplay and lets all the children inherit the socket to the X server. I'm not familiar with the protocol, the server, or the Xlib implementations, but I can see that with some design choices, there might be a problem. If, for example, state is kept by both the server and client on a per-connection basis, the client-side info would get out of sync in the various processes. 2) Each child calls XOpenDisplay itself, and uses its own private socket to communicate with the server. Since X identifiers are unique to the server, there's no problem with passing IDs around among the various processes, and presumably, they could all write to the same window. The problem here is that this approach uses *lots* of sockets, which may be a resource problem in the Unix implementation, and could also cause problems if the server keeps per-connection data without expecting someone to come along with *hundreds* of connections. Can the server run out of file descriptors in this case? In case you're wondering, the system in question is a parallel processor with up to 128 processors (the Butterfly GP1000). Users often run programs with one process per processor, all cooperating on the same computation. I'd like to have a workable strategy for handling X output from such programs. Any suggestions? ---Walter