Thread: setjmp/longjmp
View Single Post
  #5   Spotlight this post!  
Unread 25-01-2007, 09:23
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: setjmp/longjmp

Oooo, I just learned about semi and full coroutines in my concurrency class. That WOULD work nicely for the camera instead of the statemachine. But I imagine you'd be spending most of your time debugging your implementation rather than actually working on robotics code.

Quote:
Also remember that since the processor is not multithreaded, so there is no "giving up" the CPU.
A context switch simply involves saving all the current registers in the CPU to memory, loading all the saved registers from another thread into it, and letting it run from there. You don't need any special features in the CPU to do it. Coroutines would be implementable, since they don't really even involve concurrency. You just jump to another stack, execute for a bit, then yield back.