locked
what is the different between _beginthread() and AllocStartThread() RRS feed

  • Question

  • what is the different between _beginthread() and AllocStartThread()

    in umxsdrbrick - startbaseband11a():

     hTxNormalThread = _beginthread ( Dot11aSendThread, 0, NULL);

    in umxsdra - startbaseband11a():

    hTxThread = AllocStartThread ( Dot11aSendProc, NULL);

    I need to reconfigure the sora CentralFreq and TxGain, so I have to stop baseband and restart baseband, but when I tried to stop baseband, it went wrong. I wonder if the problem occured when using Stopbaseband()

    void StopBaseband () {
        StopFreeThread(hRxThread);
        StopFreeThread(hViterbiThread);
        StopFreeThread(hTxThread);

        while(Root) {
            MAC2TxID* temp;
            temp = Root;
            Root = Root->m_next;
            FreeTxResource(&temp->m_tid);
            free(temp);
        }

        IReferenceCounting::Release (pBB11bRxSource);
        IReferenceCounting::Release (pBB11bTxSource);

        IReferenceCounting::Release (pBB11aTxSource);
        IReferenceCounting::Release (pBB11aPreambleSource);
        IReferenceCounting::Release (pBB11aRxSource);

        IReferenceCounting::Release (pBB11nTxSource);
        IReferenceCounting::Release (pBB11nLPreambleSource);
        IReferenceCounting::Release (pBB11nHtPreambleSource);
        IReferenceCounting::Release (pBB11nRxSource);

    Monday, April 28, 2014 3:13 AM

Answers

  • Hi Songpeng,

    I can see 2 questions in your post. The first one: what is the difference between _beginthread() and AllocStartThread()?
    _beginthread is the C Run-Time Library API to create a thread. AllocStartThread is the Sora thread API to create and start a Sora thread. It internally calls SoraThreadAlloc and SoraThreadStart functions. Please refer the chapter 'Real-Time Support' in Sora Manual for more details.

    If you also want to know the difference between Sora thread and normal CRT thread, Sora thread is a non-interruptible thread running on a multi-core system. Its implementation uses dedicated CPU cores and multiple normal thread to achieve this, and cost much more resources (CPU cores, etc) than normal threads. So we choose normal thread for 802.11a TX thread, in order to run it on 4-core CPU.

    The second question: how to reconfigure the sora CentralFreq and TxGain?
    You don't need to stop baseband to reconfigure them. I am not sure what's wrong when you stop baseband. If you still meet problems, please provide more detailed information.

    Thanks, -Qi

    • Proposed as answer by Qi LuoEditor Sunday, May 4, 2014 6:02 AM
    • Marked as answer by Songpeng Li Sunday, May 4, 2014 7:40 AM
    Sunday, May 4, 2014 6:02 AM
    Answerer

All replies

  • Hi Songpeng,

    I can see 2 questions in your post. The first one: what is the difference between _beginthread() and AllocStartThread()?
    _beginthread is the C Run-Time Library API to create a thread. AllocStartThread is the Sora thread API to create and start a Sora thread. It internally calls SoraThreadAlloc and SoraThreadStart functions. Please refer the chapter 'Real-Time Support' in Sora Manual for more details.

    If you also want to know the difference between Sora thread and normal CRT thread, Sora thread is a non-interruptible thread running on a multi-core system. Its implementation uses dedicated CPU cores and multiple normal thread to achieve this, and cost much more resources (CPU cores, etc) than normal threads. So we choose normal thread for 802.11a TX thread, in order to run it on 4-core CPU.

    The second question: how to reconfigure the sora CentralFreq and TxGain?
    You don't need to stop baseband to reconfigure them. I am not sure what's wrong when you stop baseband. If you still meet problems, please provide more detailed information.

    Thanks, -Qi

    • Proposed as answer by Qi LuoEditor Sunday, May 4, 2014 6:02 AM
    • Marked as answer by Songpeng Li Sunday, May 4, 2014 7:40 AM
    Sunday, May 4, 2014 6:02 AM
    Answerer
  • Thank you!

    That helps a lot, thanks again.

    - Songpeng

    Sunday, May 4, 2014 7:40 AM