[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-dev] OSC reciever crashes
On Sunday, Nov 30, 2003, at 15:20 US/Eastern, Julian Rohrhuber wrote:
one thing I could imagine that an OSCResponder might be
recieving too many messages in a short time. It creates an OSCresponder object
for every message it recieves (for the lookup), so maybe there is too many objects.
I don't know of this helps you or not, but while I was stress testing Voicer, I did find that asking Voicer to initiate too many notes too quickly would cause the language to crash. Not long after that, I simplified the algorithm somewhat and it hasn't been a problem since then. At the time I speculated that events were piling up in the scheduler thread faster than they could be completed, which could result in some sort of stack overflow.
You might try to measure the average time it takes for OSCresponder to finish its work. Say,
OSCresponder {
classvar <allTimes;
.....
initClass {
all = Set.new;
allTimes = [];
}
*respond { arg time, addr, msg;
var cmdName, responder, match;
allTimes = allTimes.add(Main.elapsedTime);
......
allTimes = allTimes.add(Main.elapsedTime);
^true
}
.......
}
Then create all the responders you're using in your setup (important because the more responders you have, the longer Set-scanFor can take), and fire a couple hundred messages at a rate you know your machine can handle. When that's done, you can get an array of execution times:
a = OSCresponder.allTimes.clump(2).collect({ |pair| pair[1] - pair[0] });
Could yield some interesting data ...
James
____________________________________
H. James Harkins /// dewdrop_world
http://www.duke.edu/~jharkins
"If attacked by a lion, thrust your arm down his throat.
This takes some practice." -- Cyril Connolly