Data Pipe Manager (PIP Module)
6-14
The pipe's reader function, the HWI routine, calls PIP_get to read data from
the pipe. The pipe's writer function, the SWI routine, calls PIP_put. Since the
call to the notifyReader happens within PIP_put in the context of the current
routine, a call to PIP_get also happens from the SWI writer routine.
Hence, in the example described two threads with different priorities call PIP_get
for the same pipe. This could have catastrophic consequences if one thread
preempts the other and as a result, PIP_get is called twice before calling PIP_free,
or PIP_get is preempted and called again for the same pipe from a different thread.
Note:
As a general rule to avoid recursion, you should avoid calling PIP functions
as part of notifyReader and notifyWriter. If necessary for application
efficiency, such calls should be protected to prevent reentrancy for the
same pipe object and the wrong calling sequence for the PIP APIs.
Summary of Contents for TMS320 Series
Page 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Page 16: ...xvi ...
Page 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Page 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Page 202: ...5 20 ...
Page 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Page 288: ...Index 10 Index ...