General Question about Multithreading

I didn’t want to hijack Gismofx thread, but this does tie into some of his questions.

It was my understanding, that the Thread Scheduler was ran at the CRL level…
But yet, when digging into the 1-Wire protocols at the PAL Layer, I run into this

 //timing critical, so I'll disable interrupts here
GLOBAL_LOCK(irq); //EA = 0;

Then in reading more, I find:

  1. So, my questions are: Does the CRL thread scheduler use irq’s to decide when to switch threads?
  2. If there is a long enough Delay added in the PAL layer, will it allow a separate thread to run while its paused?
  3. If a PAL Routine is started, but its execution takes longer than the thread time that it is called from, will it swap threads or wait till the execution is finished?
  4. Same question as #3, but the HAL Layer, ie

as it seems that erasing / programming flash would be very critical?

1 Like

Excellent questions (certainly piqued my interest), but since it is 4.4-related and deeper in the innards than we usually get here, you might get a better answer over on the netmf gitter discussion or by posting an issue on github.

So if that interrupt is disabled, then we can get some level of determinism from the framework. I could really use that right now.

1 Like

If anyone is interested, Steve Maillet responded to the questions, and although there isn’t simple answers to them, it does help clarify how Netmf works.