defer -> delay or delay -> defer to schedule a low-priority event ?

Dec 12, 2012 at 12:22pm

defer -> delay or delay -> defer to schedule a low-priority event ?

Hello,

In the tutorial “Event Priority in Max (Scheduler vs. Queue)” (http://cycling74.com/2004/09/09/event-priority-in-max-scheduler-vs-queue/), it is written: “Note that only the high priority scheduler maintains timing information, so if you wish to schedule a low priority event to execute at a specific time in the future, you will need to use the delay or pipe objects connected to the defer or deferlow objects.”

I don’t undestand whether one should place the delaying objet first or the deferring object first.

Any idea ?

#65649
Dec 12, 2012 at 1:37pm

Hi,

according to the sentence that you quoted, since [delay] deals with timing, we can securely assume that it’s executing in the scheduler queue. This means that, regardless of the source of the bang that triggers the delay, the outlet of the [delay] object will send stuff on the scheduler queue. Therefore, the correct order of getting a delayed bang (or anything else) in the low priority queue is:

[delay]
|
[defer(low)]

Hope that helps,
Ádám

#236468
Dec 12, 2012 at 3:02pm

Hi,

Join a patch to understand the difference (and consequently approved Ádám Siska).

void flop_bang(t_flop *x)
{
    if (systhread_ismainthread( )) {
        post("Main");
    } else {
        post("Timer");
    }
}
Attachments:
  1. Flop.zip
#236469

You must be logged in to reply to this topic.