Hello,
I want to know what compile options are needed and where to put them, to get multi-threaded opengl.
I’m using kdevelop 3.2.2
thanks,
rene
Hello,
I want to know what compile options are needed and where to put them, to get multi-threaded opengl.
I’m using kdevelop 3.2.2
thanks,
rene
a simple multithreaded prog could look like this:
#include<stdio.h>
#include<stdlib.h>
#include<pthread.h>
void MyThread(void *thread_arg) {
int *I = (int*)thread_arg;
int counter = 0;
printf("
thread started with argument %i
", *I);
while(true) {
system("sleep 1");
printf(" %i
", counter ++); } }
int main(int argc, char *argv[]) {
pthread_t my_thread;
int value = 1234;
pthread_create(&my_thread, NULL, (void*(*)(void*))MyThread, &value);
printf("
thread created
");
while(true);
}
//
// gcc -o threads threads.cc -lpthread
//
all you need is the pthread lib, which is selected with the compiler flag ‘-lpthread’
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.