[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Displaying live video -- how to notify main loop from another thread
From: |
Marek Peca |
Subject: |
Re: Displaying live video -- how to notify main loop from another thread? |
Date: |
Fri, 9 Jul 2010 15:42:34 +0200 (CEST) |
It is not required, however GNUstep does need to know that the app is
multithreaded. (..)
On 9 Jul 2010, at 13:56, Richard Frith-Macdonald wrote:
(..)
There are quite a few things which use NSThread, and if you call them
from an unknown thread you are asking for trouble.
Currently the API to handle this is to call GSRegisterCurrentThread() in
each thread before it calls any other gnustep code, and call
GSUnregisterCurrentThread() when your thread is about to exit.
You do not need to do this for any thread which doesn't use GNUstep
though.
So, if I'm getting it right, I should follow the following scenario:
- create several threads using pthreads
- for each of them (probably only one of them), call
GSRegisterCurrentThread() at the beginning
- then, I may call NSView -setNeedsDisplay:, but it currently does not
work, so I should use performSelectorOnMainThread... instead
OK?
Thank you,
Marek
Re: Displaying live video -- how to notify main loop from another thread?, David Chisnall, 2010/07/09