Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - henk23

Pages: [1]
1
System / Mutexes
« on: July 07, 2009, 12:16:03 am »
Hi!

Is it possible to use the mutexes like this:

Code: [Select]

void thread_1()
{
  while(1)
  {
    wait_for_important_data();
    process_important_data();
  }
}

void thread_2()
{
  while(1)
  {
    provide_important_data();
    sleep(0.07 seconds);
}


the provided data is a picture from my webcam at about 15 frames per second.

the process is displaying the picture as an openGL-texture.

it's part of a big project, so there will be no other way of doing it.

i have tried it like this but it doesn't work:

Code: [Select]

void thread();
{
  while(1)
  {
    provide_data();
    mutex.unlock();
  }
}

void main();
{
  thread.launch();
  while(1)
  {
    mutex.lock();
    use_data();
  }
}


what can i do? :)

Pages: [1]