Stop pre-emption

Hi there.

I have a system critical function that i want to protect from being stopped by the qnx system scheduled. I guess one was to do this would be to temperarily raise the priority to 255 and set to FIFO? But I don’t think this would stop interrupts being handled, and also this in not a very nice method in my eyes.

Does anyone know if there is a QNX function call to deal with this sort of thing? for example:

QNX_stop_scheduling();
// Do some critical stuff
QNX_start_scheduling();

Cheers

InterruptEnable(),InterruptDisable(), InterruptLock(), InterruptUnlock() are your friends.

That’s exactly right. Just be aware that all kernel calls turn interrupts back on again, so you have to be careful what code goes between the Disable/Enable pair. For example, printf() will re-enable interrupts.