Viatly wrote:
> I 'd like to know whether single-threaded gcc can be used for:
> 1. Writing multithreaded C app ( gcc file.c -pthread ).
> 2. Writing multithreaded C++ app ( g++ file.cpp -pthread ).

Short answer: YES.
But just linking it with -phread library won't make it magically
multithreaded.
I suggest you read this tutorial.
http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html

Intel C/C++ compiler does have autovectorization, and
there you can really "just recompile" with -parallel
switch. In reality, this will mostly work for simple
initialization loops, not for complex code blocks
where you want it.

In any case, there is no free lunch and some extra
work is always required.

DuĊĦan Peterc
http://www.arahne.si
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to