View unanswered posts | View active topics It is currently Sat Nov 01, 2014 7:14 am






Reply to topic  [ 1 post ] 
multiple tasks 
Author Message
Expert

Joined: Sun Aug 19, 2007 2:43 pm
Posts: 138
Location: New Jersey
Post multiple tasks
Code:

int someGlobal;
...
task GetAxis()
{
    if (someGlobal==1)
    {
       ....
       while (true)
            do these
       ...
    }
   else (someGlobal==2)
    {
       ....
       while (true)
            do those
       ...
    }
}

task main()
{
    someGlobal = 1;
    StartTask(GetAxis);
    ...
    someGlobal = 2;
    StartTask(GetAxis);
    ....
}


The 1st thread failed as soon as the 2nd thread started. So, I created two identical GetAxis, just renamed as GetAxis1 and GetAxis2, then the 2 threads run fine.

Shouldn't s separate copy "GetAxis" is started as 2nd task?


Sat Aug 16, 2008 10:54 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.