Results 1 to 5 of 5
Thread: Multithreaded App in Linux
|
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
-
06-18-2004 #1
- Join Date
- May 2004
- Posts
- 3
Multithreaded App in Linux
I'am coming back to the forum after a long time.
Actually, I developed a multi-threaded C application(9 threads). This was done in linux RH9(using POSIX threads).
And the same application was also done without any threads, but with a sequential procesing.This achieves the same task as that of its multi-threaded counterpart, except for the asynchronous processing.
To my astonishment, I found that, the total virtual memory image[code + data +stack] in Linux(using 'ps' command), for the multi-threaded process was nearly 30 times as that of the non-multi-threaded application.
I would appreciate programmers having experience in developing multi-threaded applications on linux to share their views.
Could this be a problem with my multi-threaded design ? or is it a normal behavior for multi-threaded applications to have such a huge memory foot print ?
Thanks
-
06-18-2004 #2
- Join Date
- Jul 2003
- Location
- Stockholm, Sweden
- Posts
- 1,296
how about posting the source code for your aplication so we can take a look. Also.. perhaps the "programming" section would have been more apropriate for this kind of question.
-
06-18-2004 #3
***Moved to Linux Programming & Scripting***
"Time is an illusion. Lunchtime, doubly so."
~Douglas Adams, The Hitchhiker's Guide to the Galaxy
-
06-19-2004 #4
- Join Date
- Apr 2003
- Location
- Sweden
- Posts
- 796
There are many ways i have read that multithreaded applications can be treated by the kernel, but that is up to the programmer how he is creating its childs. And if that application will be faster of it...
By fork, if so the whole memory map must be copied to the new process that will be an exact copy of its parent.
Threads, will not be an exact copy of its parent, just exexuting its own part...
Can it be possible if all threads are IO-bounded that its work is being qued in memory waiting for access to the disk, or something like that???
Just brainstorming here...Regards
Andutt
-
03-21-2007 #5
- Join Date
- Mar 2007
- Posts
- 2
Sample code to suspend a thread in linux
Hi Can anybody post Sample code to suspend a thread in linux
Thanks
Harikrishna