By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,303 Members | 1,517 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,303 IT Pros & Developers. It's quick & easy.

Is multithreading possible in c on linux platform

P: 62
HI,
i am assigned a project of grid computing. so i must know where multithreading is possible on linux. ANd by how u can do that. I know in windows MPC is available. What about linux?
Jun 7 '07 #1
Share this Question
Share on Google+
6 Replies


gpraghuram
Expert 100+
P: 1,275
HI,
You can posix multithreading in C in Linux.
Try to do a search with "Posix multithreading" and u will get the info u need.

Thanks
Raghuram
Jun 7 '07 #2

P: 62
Hi,
Thanks for ur advice. Is that both MPc and posixs are compatable.Means i want to develope an application which distribute threads to the other pcs .and it has to send the result. THe same applicaton is it possible in linux and windows.
Jun 7 '07 #3

Expert 100+
P: 181
Can you be more clear in ur requirement, what exactly you want to do??
Jun 7 '07 #4

Expert 10K+
P: 11,448
Hi,
Thanks for ur advice. Is that both MPc and posixs are compatable.Means i want to develope an application which distribute threads to the other pcs .and it has to send the result. THe same applicaton is it possible in linux and windows.
Google for 'MPI' (Message Passing Interface); it does exactly what you want.

kind regards,

Jos
Jun 7 '07 #5

weaknessforcats
Expert Mod 5K+
P: 9,197
Thanks for ur advice. Is that both MPc and posixs are compatable.Means i want to develope an application which distribute threads to the other pcs .and it has to send the result. THe same applicaton is it possible in linux and windows.
You cannot have the same threads run on both Linus and Windows. Threads on Linux must have the form:

Expand|Select|Wrap|Line Numbers
  1. void* MyThread(void*);
  2.  
On Windows the threads must have this form:
Expand|Select|Wrap|Line Numbers
  1. DWORD WINAPI MyThread(LPVOID);
  2.  
You will need Linus code and Windows code and then you must compile separately for each OS.
Jun 7 '07 #6

Expert 10K+
P: 11,448
You cannot have the same threads run on both Linus and Windows. Threads on Linux must have the form:

Expand|Select|Wrap|Line Numbers
  1. void* MyThread(void*);
  2.  
On Windows the threads must have this form:
Expand|Select|Wrap|Line Numbers
  1. DWORD WINAPI MyThread(LPVOID);
  2.  
You will need Linus code and Windows code and then you must compile separately for each OS.
Or use the Windows port of MPI; it's a great product; I can recommend it; I've
used several computer architectures ranging from Windows PCs to 512 node
IBM PSs and a bunch of Crays, all in one virtual parallel machine cluster. MPIch
is a free implementation. Google for it; it's easily found; and it's fun to use.

kind regards,

Jos
Jun 7 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.