UMX FLIP Installation Guide Page 47

  • Download
  • Add to my manuals
  • Print
  • Page
    / 142
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 46
46
Chapter 5.
Real-Time Support
5.1 Using Sora thread
Sora supports real-time behavior via exclusive threading. An exclusive thread (or ethread) is a
non-interruptible thread running on a multi-core system. In previous versions, an exclusive
thread is bound to a dedicated CPU core and the programmer should manually assign CPU cores.
Since Sora SDK version 1.5, the core assignment is performed by the library that dynamically
allocates CPU cores to ethreads.
The SDR driver should allocate an ethread object by calling SoraThreadAlloc. Then, the SDR
driver can call SoraThreadStart to start the ethread. SoraThreadStart takes three parameters: a
valid ethread handle, a user-defined thread routine, and a user-defined parameter passed to the
thread routine. If the return value of the thread routine is FALSE, the ethread will be terminated;
otherwise, the routine will be called from the Sora core library after it re-computes the best core
allocation and reassigns each ethread to a proper core. Since the ethreads are scheduled in a
cooperative way, the ethread routine must return periodically (usually when critical tasks are
done). Note that the dynamic scheduling of ethread imposes minimal overhead.
To terminate an ethread, one should call SoraThreadStop. It should be note it is prohibitive to
call any Sora Thread API from the ethread routine; otherwise, a deadlock will occur. To exit from
the thread, a user-defined routine should return with a FALSE value.
Comments: For user mode applications, the corresponding thread APIs are SoraUThreadAlloc,
SoraUThreadStart, SoraUThreadStop and SoraUThreadFree.
Figure 23 shows code excerpts from sdr_phy_main.c to initialize and start a Sora thread that
performs Viterbi decoding.
HRESULT
SdrPhyInitialize(
Page view 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 141 142

Comments to this Manuals

No comments