Re: rpcgen on linux does not generate multithreaded svc code
Matt Fahrner <[email protected]> Thu, 18 Mar 2004 09:29:14 -0500
| Newsgroups | gmane.linux.redhat.devel |
|---|---|
| Organization | Burlington Coat Factory Warehouse |
| Message-ID | <[email protected]> |
Linux's RPC code appears to be based on a very old iteration of SunRPC that was put into public domain quite some time ago. The later revs, which are not public domain, included support for (actually the migration to) TLI with protocol independence. Subsequently TLI was stillborn, but whatever. In any case, as far as I know only Sun's RPC intrinsically supports threads. I have never seen another implementation that does. You can do your own threading, if nothing else by editing the generated files, but it's not clear that the RPC routines themselves are thread safe - in fact I would guess they are not based on the fact that they usual a lot of global data. Personally I'd love to see a thread safe RPC for Linux, but it's probably not worth the effort. A better bet would be to maybe use XML RPC if you can (though that doesn't seem to have the same depth of capabilities). Unfortunately, to get threading, you'll probably either have to add a lot of hacks, or write your own socket code and API getting rid of RPC. - Matt ashish borkar wrote: > Hello, > In linux the rpcgen command does not generate multithreaded code. > When I run the rpcgen command on a .x file with -M option (-M generate > MT-safe code) in SUN it generates code whose main() has this line: > int mode = RPC_SVC_MT_AUTO; > But when I run the rpcgen -M command in Linux the code generated is very > different and does not have int mode = RPC_SVC_MT_AUTO; > Due to this during stress test(i.e. multiple parallel requests) to > the rpc server on Linux the client gets many RPC failed error > messages.This does not happen in SUN. > Also when I log the thread id in a log file it shows only a single > thread which suggests that the svc code is not multithreaded. > What is the solution for this? > Thanks & Regards > Ashish > > > Do you Yahoo!? > *Yahoo! Mail* <http://us.rd.yahoo.com/mailtag_us/*http://mail.yahoo.com> > - More reliable, more storage, less spam > > > ------------------------------------------------------------------------ > > _______________________________________________ > Redhat-devel-list mailing list > [email protected] > https://www.redhat.com/mailman/listinfo/redhat-devel-list -- --------------------------------------------------------------------- Matt Fahrner 2 South Park St. Manager of Networking Willis House Burlington Coat Factory Warehouse Lebanon, N.H. 03766 TEL: (603) 448-4100 xt 5150 USA FAX: (603) 443-6190 [email protected] ---------------------------------------------------------------------