Thanks everybody for your conversation, this is great. I've got some comments on the messages posted to date on this topic:
"Gavin Maxwell" <[EMAIL PROTECTED]> wrote in message news:72987@palm-dev-forum... > > That is correct. The AMX kernel supports multi-threading, but Palm are not > allowed to expose that functionality to developers. PalmOS runs on top of a product called the "Kadak AMX 68000 Multitasking Kernel", so it's obvious that Palm simply didn't to expose more than one kernel thread to its developers, even though the kernel is multithreaded. The one thread we get to use is often called "the UI thread". Third parties can license the AMX kernel and in theory utilize its multithreaded nature ( http://www.kadak.com/html/kdkp1640.htm#Palmq ), but this is beyond mere mortals. Having worked with a licensed version of this AMX kernel myself, I can say it's a lot more difficult than it sounds to put additional kernel threads to work on a PalmOS application, and the alternative (using a user-level thread library to multiplex multiple threads on top of the single UI thread) is less expensive, more portable, and is much less difficult. It's interesting to note that Netlib runs on its own, separate kernel thread. This way, the TCP/IP stack is able to sit around and collect and assemble incoming network data into its internal buffers completely independantly of what the UI thread is doing. I believe there was also a third AMX kernel thread that PalmOS used for some similar ancillary purpose (maybe something to do with syncing?). But the fact of the matter is, developers only get to use "the UI thread." If a developer needs to use multiple threads, then s/he must implement a user-level thread library which multiplexes multiple threads ON TOP of the one and only UI thread. I indicated one was built in to J2ME's java.lang.Thread class, which is a huge timesaver if you don't mind Java development. Joe Programmer pointed a GCC-specific thread library (that its author calles a kernel for some reason): > FYI: Dan Pronovost of DeepNet Technologies has written a "lightweight > coordinated multitasking kernel for Palm OS" for anyone who can't live > without some multitasking. See > http://home.golden.net/~deepnet/old/coordtask.html Thanks for that reference, Joe, I was unaware of this. Using a user-level threading library like Green threads or DeepNet's CoordTask on the Dragonball family of CPUs is REALLLLY slow, but I'm sure the move to ARM chips will make these thread libraries run at a reasonable rate so that we can develop RESPONSIVE multithreaded apps for the Palm. This is still a far cry from WinCE development, where spawning a new thread is simply a matter of a built-in OS calls (CreateThread or AfxBeginThread). No need to figure out a third-party threading library, roll your own, or use Java-ify your project and use java.lang.Thread. Most respectfully, the simplicity of PalmOS hasn't really had a need for multithreading until recently. But with lots of computationally-intensive technologies looming on the horizion, if Palm wants successfully to compete with Windows CE, merely switching to the same fast ARM CPU isn't going to do it. Truely innovative multitasking applications call for BUILT-IN threading support -- relying upon third-party threading libraries will chill Palm innovation and development because most people can't or won't go this very involved route. Again, offloading MP3 decoding to a separate thread, or spawning server response threads for the "ad-hoc networking" that Bluetooth promises, is going to be very klunky without built-in threading support. So we've still not heard from Palm whether there are plans for built-in threading support. It's really not extraordinarliy difficult to incorporate multithreading into any well-architected operating system, and it is typical that an OS begins its life singly-threaded and then evolves into multi-threading as the need arises. I think we have reached this need. I'd be happy to implement this into the PalmOS myself, to whom do I send my resume? :) Thanks again for the discussion, -Jeff Ishaq ishaqjunk AT hotmail DOT com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
