majumdar@bgsuvax.UUCP (anindo Majumdar) (04/17/91)
Are the servers created using SUN's rpcgen mechanism capable of supporting multiple clients? If so how many can they support at one time and do they have to fork another process for each new client?Is there any way wherby these servers can have multiple threads of control thus enabling them to supportmultiple clients without the overhead of context switches,new child processes ? Any pointers will be greatly appreciated. Thanks Anindo Majumdar Internet address : majumdar@andy.bgsu.edu
thurlow@convex.com (Robert Thurlow) (04/24/91)
In <7334@bgsuvax.bgsu.edu> majumdar@bgsuvax.UUCP (anindo Majumdar) writes: >Are the servers created using SUN's rpcgen mechanism capable of supporting >multiple clients? If so how many can they support at one time and do they >have to fork another process for each new client?Is there any way wherby >these servers can have multiple threads of control thus enabling them to supportmultiple clients without the overhead of context switches,new child processes ? >Any pointers will be greatly appreciated. You can do anything you want, as long as you mind the tradeoffs. RPC programs are collections of 'remote procedures' that can be accessed by local or remote processes without much regard to where the server lives. RPC does not itself provide concurrency or lightweight process contexts. If you wish to use a threads package inside the dispatch routine, you can probably go ahead and do that. Normally. you code what you need. If a procedure is doing something that can be turned around very quickly, your server can simply allow clients to wait until it gets to them. If the procedure is more time-consuming, it may be better to fork a new process to handle an individual transaction. The best place to start is Sun's RPC/XDR Programmer's Reference; the examples are good, and will give you an idea of how the programs are structured. Rob T -- Rob Thurlow, thurlow@convex.com An employee and not a spokesman for Convex Computer Corp., Dallas, TX