dynamically changing select{} cases from another thread

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
pems
Newbie
Posts: 1
Joined: Tue Dec 22, 2009 5:50 am

dynamically changing select{} cases from another thread

Postby pems » Tue Dec 22, 2009 6:25 am

Hi

I was wondering if it is possible to change case conditions dynamically in one thread from another thread?

for example:
one thread would look something like that:

while(1){

select{
case <some cond>
<do something>
break;
case <some other cond>
<do something else>
break;
...
}

}

so i was wondering if it is possible to have another thread change the case conditions while the select block in the first thread waits on some set of initial conditions?
I.e can i somehow manage the case conditions that one thread waits for from another thread?
I need this because i need the system to react very accurately to the constantly changing stimuli, and if i introduce some case managing code to the same thread that waits on the stimuli, it may delay the reaction to the stimuli (say when condition fires during the time management code is executing) and will make it not perfectly real-time as required.

if anyone has some other suggestions on how to implement this, i'd appreciate hearing them

Thanks

Who is online

Users browsing this forum: No registered users and 3 guests