FROM : Jens Alfke
DATE : Fri May 02 17:27:17 2008
On 2 May '08, at 4:20 AM, Jean-Daniel Dupas wrote:
> You can have a look at DistributedObject. I think you can publish a
> drawer object in your drawing thread and then, just call draw fro
> your main thread.
DO might be overkill for this scenario. The background thread really
just needs to run a while() loop that waits on a condition-lock, then
draws. The main thread's -drawRect: method just sets the condition on
the lock to trigger the background thread.
If more information needs to be passed to the thread, you can use a
producer/consumer queue, but unfortunately Foundation doesn't come
with one of those built-in; there must be source code for one lying
around, though.
—Jens
DATE : Fri May 02 17:27:17 2008
On 2 May '08, at 4:20 AM, Jean-Daniel Dupas wrote:
> You can have a look at DistributedObject. I think you can publish a
> drawer object in your drawing thread and then, just call draw fro
> your main thread.
DO might be overkill for this scenario. The background thread really
just needs to run a while() loop that waits on a condition-lock, then
draws. The main thread's -drawRect: method just sets the condition on
the lock to trigger the background thread.
If more information needs to be passed to the thread, you can use a
producer/consumer queue, but unfortunately Foundation doesn't come
with one of those built-in; there must be source code for one lying
around, though.
—Jens
| Related mails | Author | Date |
|---|---|---|
| Graham Cox | May 2, 09:13 | |
| Kyle Sluder | May 2, 10:13 | |
| Graham Cox | May 2, 13:07 | |
| Jean-Daniel Dupas | May 2, 13:20 | |
| Jens Alfke | May 2, 17:27 | |
| Graham Cox | May 2, 17:30 | |
| Jean-Daniel Dupas | May 2, 18:04 | |
| Duncan | May 3, 05:40 | |
| Graham Cox | May 3, 06:51 | |
| Duncan | May 3, 13:36 | |
| Jean-Daniel Dupas | May 3, 13:57 | |
| Graham Cox | May 3, 14:52 | |
| Jean-Daniel Dupas | May 3, 15:22 | |
| Graham Cox | May 3, 15:30 | |
| Ricky Sharp | May 3, 15:44 | |
| Jean-Daniel Dupas | May 3, 15:55 | |
| Graham Cox | May 3, 16:11 |






Cocoa mail archive

