M4L Multi-Threading Question

3 posts / 0 new
Last post
aminoplacid
Offline
Joined: 11/15/2009
M4L Multi-Threading Question

So I am wondering the best approach for multithreading in M4L.  My little APC40 Mouse device takes up a bunch of CPU cycles (probably due to the amount the aka.mouse object is called).  In a pure Max environment, I would probably use the deferlow object to keep processing of the mouse movement at lowest priority.  However, I am unsure if this would even make a difference with this device as the Max runtime seems to be within the process space of the Live environment.
In another programming language I would probably just spawn a new thread which leads me to think that I should create a Java object to create a thread to process these actions outside the context of Live (thus not using the aka.mouse object).
Is there are better way to do this so I can still use the aka.mouse object?  Is there a better way than creating a Java object?
Perhaps a tutorial on multi-threading in M4L would be sweet if someone has done this.
Cheers~ D

Anonymous

afaik, you have 2 threads inside max4live/ableton environment.
so you could simultanously do 2 things. the problem is i practically never got it to work that way: i always have to use the low priority queue

i dont know if you saw this already, but give it a try
http://cycling74.com/2004/09/09/event-priority-in-max-scheduler-vs-queue/

i am also wondering if you can use the objects of max for external programmming, this would be awesome, perhaps some senior programmer could give us a hint to the right direction :)

negotiator
Offline
Joined: 04/16/2010

to update the last post: there are 2 threads in max environment, but i dunno 4 sure how it is in max for live.

although i have seen patches assigning message-flows to high and low priority, i cant tell if its executed in 2 threads or max for live just pretends to have 2 threads and executes them all in 1 thread