advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   TIP BANK
Browse DevX
thread.zip
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
 

Cooperative Multithreading in BREW with IThread

Learn how to harness cooperative multithreading in BREW to avoid writing applications that block the CPU during lengthy operations. 


advertisement
y last article mentioned the BREW IThread as a possible solution to the challenges of dealing with blocking code on BREW. Whether you're porting existing code to BREW or writing new code, the IThread interface can be quite handy. Sadly, in my experience it's one of the most misunderstood and maligned interfaces provided by BREW—developers seem to overlook it and write code which provides the same functionality (using AEECallback and ISHELL_Resume), often because they have decided that since BREW doesn't provide preemptive multithreading there's little point in using IThread. Unfortunately, this approach leads to additional testing and debugging, as well as code that requires additional documentation (or time invested in understanding where no documentation is presented).

This article begins by explaining the basic principle behind cooperative multithreading and then shows you the basics of the IThread interface. Rather than just give you some code samples along the way, you can download hellothread.c and follow along; bits of the actual file are included here for your reference.


It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com.
Already a member?



advertisement