If you don't mind, would you be more specific on how these two
threads can commuicate? I still don't know how to do that even
though I do understand the semaphore. My specific concerns are: can
they control/stop each other? can they read data from the other
thread's data storage (database, feature, etc)? how can one thread
notify the other of some status?

As I said before, there are no supported or documented methods to control or manage threading on 5.x and earlier. And even what's implemented is extremely bare-bones. I'd recommend having a shared area of memory and write reentrant routines to (very carefully) let them "communicate" without needing semaphores, mutexes, or anything else. Get a CS book and look up the techniques :-) There's no OS support, and this is certainly not an easy topic.


As for reading each other's data: all data is accessible to everyone; that's easy. What's hard is making sure the data isn't being changed while the other thread is in the middle of reading it, and making the system reliable. Welcome to the world of writing OS primitives for an OS which wasn't designed to handle what you're doing. (And join us in wishing that Palm OS Cobalt devices would hurry up and ship so this'd be built-in and fairly easy!)

-David Fedor
PalmSource, Inc.

--
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to