Прерывание и возобновление кода из очереди в циклеC++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 Прерывание и возобновление кода из очереди в цикле

Сообщение Anonymous »


I have queue with objects, which are executed sequentially. There is no operating system, I'm just using the hardware and my code:

while(true) { if( next = queue.next() ) { next->do_stuff() } } Now I want to suspend the code which is executed at next->do_stuff(), based on some hardware interrupts (there are no more details needed about the hardware interrupts). This suspend should save the state (current instruction) and enqueue the next back to the queue, so that the next do_stuff of this next starts at the last instruction, before suspending it. I know, how to safe the state, but I have no idea, how to return from do_stuff. I think, this should be done with assembly.

Some Buzzwords what to search for, would be really nice. Thanks


Источник: https://stackoverflow.com/questions/432 ... -in-a-loop
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»