1 Reply Latest reply on Apr 3, 2017 12:01 AM by hima

    Is it possible to get a race condition in PSoC?

    tkosiyat_1665816

      From my understanding, BLE subsystem (BLESS) runs concurrently with the main loop in the main() function. If both share a variable, is it possible to get a race condition? If it is possible, how to prevent it? Does PSoC creater supplies a mutex like object that we can use to lock/unlock?

        • 1. Re: Is it possible to get a race condition in PSoC?
          hima

          Hello,

             

          Yes BLESS and main runs parallel.All the BLE events will automatically call the BLE event handler. All processes will be updated to the stack while CyBleProcessEvents( ) is called. All the updates happens after this based on the BLE packets. If the code is written in the way as mentioned in the code examples, race conditions will not occur.

             

          Thanks,

             

          Hima