I guess what I need is an example vi showing my ideas. The original
question is just thoughts on how I can make a better RT deterministic
time-critical vi that can respond to events too. To get rid of the
polling in the time-critical process, I'm thinking that the event
structure with user-events could be used to accomplish this.
Lets think about semaphores for a second. Why can I not use
semaphores in both the time-critical process and in the
non-time-critical process? The answer is simple, because the semaphore
functions use the same vis that call a CIN (a.k.a. shared resource).
Therefore, this could cause a priority inversion. For example, the
non-time-critical process calls Acquire Semaphore.vi. At that same
time, the thread switches to the time-critical vi and interrupts the
non-time critical process. The time-critical runs its code until it
also tries to acquire a semaphore. It can not because the non-time
critical process was in the middle of calling acquire semaphore.vi.
The thread must switch back to the non-time-critical process and finish
running acquire semaphore. Suddenly, you have a lower-priority task
preempting a high-priority task. My deterministic application has now
become less deterministic and introduced some jitter.
The above is an example of a shared resource causing a priority inversion. Can the same thing be caused by the event structure?