63,535 pts.
 How to begin a thread with C, C++ on Linux
Hi everybody. I'm developing a C program, which uses tcp sockets, but I need it to be multi-thread, on the server side. In the past, I have made that on ms windows, using the beginthread or beginthreadex functions. Can somebody tell me how to create a thread on Linux ? Thanks in advance.

Software/Hardware used:
ASKED: October 31, 2005  4:29 PM
UPDATED: October 31, 2005  4:47 PM

Answer Wiki:
The easiest way to do this is: if (!fork()) { // We're in the new thread doNewThreadStuff(); exit(0); } // We're in the old thread. Continue on. See also pthread. There's a good description of it at techpubs.sgi.com. --- Sheldon Linker Linker Systems, Inc. www.linkersystems.com sol@linker.com 800-315-1174 +1-949-552-1904 from outside North America
Last Wiki Answer Submitted:  October 31, 2005  4:47 pm  by  SheldonLinker   15 pts.
All Answer Wiki Contributors:  SheldonLinker   15 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _