astewix
04-18-2003, 06:51 AM
Hi Everyone,
Just wondering if someone could provide an example of spawning a few threads in C++ and just getting each thread to print something to the console. I've been searching around for some example code yet none of them work (it compiles fine but seg faults when pthread_create is called).
Am i supposed to compile it with some special flags or something? I am running gcc version 3.2.2 and it is configure with --enable-threads=posix.
Your help is appreciated.
Just wondering if someone could provide an example of spawning a few threads in C++ and just getting each thread to print something to the console. I've been searching around for some example code yet none of them work (it compiles fine but seg faults when pthread_create is called).
Am i supposed to compile it with some special flags or something? I am running gcc version 3.2.2 and it is configure with --enable-threads=posix.
Your help is appreciated.