ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
hi,
i want to exectute a C pgm in another linux m/c from my linux m/c using a C pgm . both m/c's are connected to a common network. Is there any way of doing this . I am totally baffled . If anybody knows please help me
pgm?? m/c? is it too hard to write "program" or "machine"? what do you want to achieve? there are plenty of ways to execute programs remotely, ssh, rexec etc...
I think what you're asking falls under the (extremely broad!) category of "distributed processing".
If you were starting out with a specific platform, your choices might relatively straightforward. A Java programmer, for example, would likely go straight to RMI (low level) or J2EE (an entire infrastructure). A Windows programer would go straight to .Net (an amorphous term that basically means "Buy Microsoft, Use Visual Studio, and Don't worry about that Man Behind the Curtain!").
But in reality, your choices are almost limitless. You can use rexec and ssh (as suggested above) to run existing programs on specific hosts. You can implement your own protocol with your own programs using sockets or RPCs. You can take an SOA/Web Services approach. You can take an HPC approach. Or a Grid computing approach. You might even be able to write a simple Ruby on Rails web app and be done with it! Etc etc. The possibilities are endless.
SUGGESTED STARTING POINTS:
Please scan these articles, and post back new questions about specific technologies that might look appropriate for your project:
3) Do your own google search on keywords like:
"distributed computing"
"Remote Procedures"
"concurrent programming"
"parallel programming"
"client/server"
A very simple solution, assuming I understand your problem, is to run a server on a machine and make requests to it. A good choice is to make a cgi request to a webserver.
CGIs can be written in lots of languages and the arguement(s) can specify parameters. This is cheap and dirty but extremely simple to implement. Another advantage, btw is that you also have lots of ways to have the requestor call the program on the remote machine as, again, you have lots of language choices. Almost all of them, including C understand an http request construct ...
From the nature of your question you are not too savvy about distributed computing (no offence meant). However, making "web based" requests is simple and you do not need to write or install rpc daemons which may be unfamiliar to you.
Assuming that "system ("rexec myprog")" doesn't work out, I suspect Cythia_thomas might feel comfortable writing a sockets app ... and might even enjoy using this as an opportunity to play with Ruby on Rails:
It is VERY obvious that Cynthia is not too network/linux saavy and I fear may not be up for writing server daemons or socket apps.
I was just trying to give her a very simple way to get started. Yes, cgi is 1995, but I manage 10000+ servers for over 850 domains. 80% + still use cgi (or a derivitive). New apps are rolled out daily -- using cgi. Even my broker uses PHP with GET/POST to .php (which is a cgi).
Were Cynthia to start writing socket apps, I think we would be here till next year helping to debug the code.
When I was teaching at "the farm", I quickly learned to start programmers off with relatively simple methods to get jobs done -- where conceptually the student began to grasp the underlying concepts -- in this instance as it applies to distributed computing. Later, when the light went on the better students immediately said "Uh hah, there is a better way ..." --time to introduce more advanced concepts.
If this is a business app this type of solution can be rolled out in an hour or two. Compare that with several man/women weeks learning socket programming and debugging what would probably be a poorly designed application.
So just my two cents. Were I managing the project I would encourage Cynthia to get the app out ... refine it later if the need merits additional resource committments.
Striking that most of the posters exhaust themselves in trying to guess what the OP means, and provide lengthy explanations of that, while the OP does not even take the effort to elaborate on what her problem is.
No offense, sometime I am so stupid myself, or I google for the poster, and reply with the first of the 2.765.897 links found.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
Advertisement
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Click Here to receive a complimentary subscription courtesy of LQ.