Results 1 to 2 of 2
I'm going to writing multi-thread/multi-process program. One thread read data from serial port. One thread, send this data to server. And main thread will initialize and monitor these two threads. ...
- 12-13-2011 #1Just Joined!
- Join Date
- Sep 2011
- Posts
- 1
what is better pthread() or exec()?
I'm going to writing multi-thread/multi-process program. One thread read data from serial port. One thread, send this data to server. And main thread will initialize and monitor these two threads. But I consider to use pthread() or exec() to for my multi-thread/multi-process program.
Can anyone give me some comments? Should I use pthread() or exec()? What is advantage and disadvantage of pthread() and exec().
Thanks in advance.Last edited by asnl1987; 12-14-2011 at 02:58 AM.
- 12-14-2011 #2
This sounds a bit like a homework question, which are not allowed on this forum.
Multithreaded and multi-process applications work quite differently. In this case, it sounds like a key part of your application is sharing data between the reader part and the sender part. Although there are methods of doing inter-process communication (IPC), sharing data within a single process is generally simpler and more efficient.DISTRO=Arch
Registered Linux User #388732


Reply With Quote