[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheduling functions to be run all the time in runloop
From: |
Dr. H. Nikolaus Schaller |
Subject: |
Re: Scheduling functions to be run all the time in runloop |
Date: |
Tue, 10 Jul 2012 08:27:56 +0200 |
Am 10.07.2012 um 08:21 schrieb Richard Frith-Macdonald:
>
> On 10 Jul 2012, at 06:20, Dr. H. Nikolaus Schaller wrote:
>
>>
>> Am 09.07.2012 um 23:13 schrieb Ivan Vučica:
>>
>
>>> They seem to be triggered whenever a "source is processed" and "before the
>>> run loop goes to sleep" - which sounds exactly like what I need. However,
>>> based on their name and the location inside Core Foundation framework, I
>>> presume that they are not implemented in this form in GNUstep.
>>>
>>> So, is there an alternative way to insert my functions whenever a source is
>>> processed and before the run loop goes to sleep that works with GNUstep?
>>
>> AFAIK, this is not available in GNUstep.
>
> Sure it is ...
>
> The Apple compatible method to do something in the next loop iteration is:
> -performSelector: target: argument: order: modes:
> The Apple compatible way to do something when the loop becomes idle is to use
> NSNotificationQueue
Ah, good to know. But it looks to be the OpenSTEP compatible way. Apple has
CFRunLoopObservers...
>
> And if you want higher performance/flexibility and don't need Apple
> compatibility, you might use the GNUstep extension -addEvent: type: watcher:
> forMode: as this allows your watcher to provide callbacks controlling
> how/when the runloop fires it.
>
> All that being said, I would have thought that animation was something that
> you would want to do at regular intervals ... so using a timer would make
> sense.
From my understanding of the documentation of the CATransaction, he wants to
batch actions and commit (flush) them once when the system is becoming idle (or
at least could become). So it is the same mechanism as being used for
setNeedsDisplay and displayIfNeeded which does not occur regularily, but when
the system has time to do so.
This is why I think it should be integrated into the GUI system (Appkit or
UIkit or something else doesn't care).
BR,
Nikolaus
- Scheduling functions to be run all the time in runloop, Ivan Vučica, 2012/07/09
- Re: Scheduling functions to be run all the time in runloop, Dr . H . Nikolaus Schaller, 2012/07/09
- Re: Scheduling functions to be run all the time in runloop, Ivan Vučica, 2012/07/09
- Re: Scheduling functions to be run all the time in runloop, Dr. H. Nikolaus Schaller, 2012/07/09
- Re: Scheduling functions to be run all the time in runloop, Dr. H. Nikolaus Schaller, 2012/07/09
- Message not available
- Re: Scheduling functions to be run all the time in runloop, Dr. H. Nikolaus Schaller, 2012/07/10
- Re: Scheduling functions to be run all the time in runloop, Richard Frith-Macdonald, 2012/07/10
- Re: Scheduling functions to be run all the time in runloop,
Dr. H. Nikolaus Schaller <=
- Re: Scheduling functions to be run all the time in runloop, Richard Frith-Macdonald, 2012/07/10
Re: Scheduling functions to be run all the time in runloop, Richard Frith-Macdonald, 2012/07/09