Hello,
I need to run three separate periodic threads with different priorities on each core so a total of 24 threads on all 8 cores. Up until now I was using the clock module and creating a separate clock instance for each thread, but now I need to use different priorities for each thread. I see 4 possible solutions to this:
1) Make each thread an SWI with different priorities and run a 1 ms timer that uses a counter to call SWI_post() for each thread as needed from the timer HWI.
2) Use a 1 ms timer with a counter to create a task for each thread with different priorities as needed from the timer HWI.
3) Make each thread an SWI with different priorities and use a clock function that runs every 1 ms with a counter that calls SWI_post() for each thread as needed from the clock SWI. The clock function would need to have a higher priority than the threads.
4) Use a 1 ms clock function with a counter to create a task for each thread as needed from the clock SWI.
I have a few questions regarding these possible solutions.
1) Are there any other ways to implement periodic threads with different priorities?
2) Are any of these (or any other) solutions recommended for general cases for whatever reason?
3) Is it possible to use a shared timer for the SYS/BIOS clock module (say timer 8)? I only see options 0-7 and ANY from the drop down box in the SYS/BIOS GUI, but I can set it to use 8 in the source and I don't get any errors when building. If so would this allow for all 8 cores to be in sync since they would be using the same timer?
4) In the same vein as the previous question, is it possible to use a shared timer for an HWI that would either create tasks or call SWI_post()? I would think that since each core needs to run 3 threads that each core would need its own HWI. If each core uses the same timer to generate the HWI, would this keep all 8 cores in sync at least for the HWI?
5) How much of an overhead difference is there between creating a task for each thread on a periodic basis vs calling SWI_post()? I would think that calling SWI_post() periodically would have better performance. Is there any reason to periodically create threads instead?
6) We will be using a watchdog timer as well. My understanding is that this uses the local timer for each core meaning timers 0-7 are used and only timers 8-15 would be available for other uses. Is this correct? If it is correct and the SYS/BIOS clock module can't use a timer shared between all cores (i.e. each core must have its own timer to use for the clock module) does this mean that with a watchdog timer for each core and the clock module in use for each core all 16 timers are used?
Regards,
Chris Johnson
Signalogic