is it possible to have a multithreaded execution environment in arduino?
if so would it be better to use the above approach for controlling two servos from a computer or do we need to do it using some other form of sending the data to the two motors from the computers
we are working on an arduino decimilia with ATMega 168 @ 16Mhz
You could probably run some sort of RTOS on the Atmega168, but RTOS's aren't something you just pick up and use. Ohterwise you are looking at busting out assembly for some nitty gritty. What do you think you need multithreading for?
Servos are far slower than the Arduino (tenth of seconds versus microseconds) , so for controlling multiple servo's with an Arduino can easily be done single threading.
Do you intend to use serial connection between PC and Arduino?
At 115200 baud you can receive a new position and a servo id within 500 microseconds or so. so two servos take one millisecond. Quite some time left to control the servo's..