Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi all,

I'm working on integrating a third-party application into the MSM6280 . This third-party application needs specific system requirements as thread, mutex and semaphore.

I am a beginner with this platform, and if somebody can help me to find information about management of thread, mutex and semaphore it will be great.

I found ITHREAD API to create thread but nothing about Mutex and Semaphore in the documentation.

If i look source code in brew folders i find OEMMutex that can help me but nothing about semaphore.

Thanks for your help.

Ok...
Nobody knows if the following mechanisms are implemented in BREW or at a lower level ?
- Multithreading?
- Semaphore?
- Thread synchronization methods?
- API used for waiting for sockets may be used for waiting for other handles?
thanks for your help.

Ok...
Nobody knows if the following mechanisms are implemented in BREW or at a lower level ?
- Multithreading?
- Semaphore?
- Thread synchronization methods?
- API used for waiting for sockets may be used for waiting for other handles?
thanks for your help.

BREW threads are cooperative, not preemptive. Consequently you don't need to protect critical memory accesses in the same way as you do on a preemptive system.
If your applications requires threading, then you will need to have a think about whether it will map well to a cooperative system; you may well find you need to insert yield points to periodically return control to the OS and to avoid blocking other threads for long periods of time.

BREW threads are cooperative, not preemptive. Consequently you don't need to protect critical memory accesses in the same way as you do on a preemptive system.
If your applications requires threading, then you will need to have a think about whether it will map well to a cooperative system; you may well find you need to insert yield points to periodically return control to the OS and to avoid blocking other threads for long periods of time.

Thanks for your answer Ben. ;)
Ok, you confirm my first opinion about multithreading on BREW platform.
This FAQ (https://brewx.qualcomm.com/bws/content/gi/common/appseng/en/knowledgebas...) give me not good news, because my work is to integrate a third party appplication and cooperative threads impact deeply the implementation of this.
May be at a lower level the Qualcomm MSM6280 platform has preemptive thread ? Do you have information about this ?

Thanks for your answer Ben. ;)
Ok, you confirm my first opinion about multithreading on BREW platform.
This FAQ (https://brewx.qualcomm.com/bws/content/gi/common/appseng/en/knowledgebas...) give me not good news, because my work is to integrate a third party appplication and cooperative threads impact deeply the implementation of this.
May be at a lower level the Qualcomm MSM6280 platform has preemptive thread ? Do you have information about this ?

You might get something if you have OEM support, but you'll still have trouble because BREW APIs are not written to be reentrant. You could also implement your own preemptive threads with some detailed knowledge of the ARM processor, assuming that you can write to the necessary interrupt vectors (never tried this myself), but you risk developing an application that will almost certainly not work on BREW 4.x.
You'd be best advised to figure out how to make your application cooperative friendly. In my experience it usually isn't too difficult, provided you are allowed to actually edit the code, and even sometimes if you can only edit the porting layer.

You might get something if you have OEM support, but you'll still have trouble because BREW APIs are not written to be reentrant. You could also implement your own preemptive threads with some detailed knowledge of the ARM processor, assuming that you can write to the necessary interrupt vectors (never tried this myself), but you risk developing an application that will almost certainly not work on BREW 4.x.
You'd be best advised to figure out how to make your application cooperative friendly. In my experience it usually isn't too difficult, provided you are allowed to actually edit the code, and even sometimes if you can only edit the porting layer.

Hi,
Sorry for barging into this thread. Is there anyway I can configure the thread priority? I do not see it in the API list.
regards,
Iqnatius

Hi,
Sorry for barging into this thread. Is there anyway I can configure the thread priority? I do not see it in the API list.
regards,
Iqnatius

No, I don't think there is any such Brew API.

No, I don't think there is any such Brew API.