by wintpe » Apr 29th, '14, 14:56
while there are options in the compiler to change the optimisations surrounding thread aware code.
the way you write a program determines if it is multi threaded.
for example, outside of programming C code, you could split up a job processing lets say 100 mpeg2 files into mpeg4 by splitting the job up, into 4 x 25 files
and running 4 single threaded conversion tools in parallel.
this is now a multithreaded job.
when you write a C program you have to split the work up into multiple threads so that it can take advantage of multiple CPU cores, or sockets.
a multithreaded mpeg2 to mpeg4 conversion program, may spit the video file, and the audio file up and break the video into chunks and then spawn multiple threads in parallel, to deal with each chunk, and then finally re-assemble the chunks into one.
this is why you sometimes hear that multicore processors such as the bulldozer and its derivatives, dont perform well in single threaded games.
there's no magical way to make that game suddenly perform faster and use all cores without a rewrite.
to compile your program, (and im assuming its simple, and no need for libraries or includes)
gcc nc.c -o nc
if it needs libraries or includes, then
gcc nc.c -I/usr/include -L/usr/lib -o nc
you will know if it needs libraries etc as the first simple compile will complain about missing include or missing libabry, or unknown function etc.
regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.