Hi Folks,
From the API references for Palm OS 5 we know there is no exposed multithread APIs as well as synchronous tools (semaphore, mutex, etc). If I try to develop an multithreaded application, how should I do it or negotiate with some organizations? I know some other companies have developed such software for Palm OS.
I wrote an article for Byte.com that addresses this issue:
http://ishaq.biz/Publications/Designing%20Multithreaded%20Mobile%20Solutions.pdf
For current versions of Palm OS, the threading model is many-to-one. On devices that run Palm OS 5.0, you can "sort of" multithread by using an ARMlet. See the armlet-forum for more info on this.
That Palm OS is many-to-one doesn't preclude you from multithreading. It just means you need to roll your own (or reuse an existing) user-level thread scheduler to maintain context and schedule the various threads' execution on the CPU. Here are your options, as I see them:
1) Look into using an ARMlet
2) For C-based apps, write your own threading library. CoordTask is one such library that has source code available. This is cooperatively multitasked, and does not have synchronization objects (MutEx etc). http://www.deepnettech.com/coordtask.html
3) For C++-based apps, write your own threading CLASS library (and let me know when you're done, I'd love to see it). I suggest extending the event pump of the Object Library for Palm OS (POL), as it already gives you a complete, tried-and-true C++ framework.
4) Consider using Java, so that you get the java.lang.Thread class, which is essentially 3) above. As a whole, Java support on the Palm is still laughable, but there are some snappy JVMs that are available if you can suffer through the development tools. Most Java SDKs for Palm development will come with a threading demo that explicitly illustrates how java.lang.Thread works on Palm OS. Really pretty cool.
5) Dare I say, look at using Microsoft PocketPC OS? For years now, it provides a many-to-many threading model via the CreateProcess() API.
6) Rumor has it that OS6 will have multiprocessing and a secure virtual memory model. The PalmSource Seminar divulged the official word on this -- but it was confidential, so I can only point you to http://www.palminfocenter.com/view_story.asp?ID=5339
-Jeff Ishaq
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
