PDA

View Full Version : Another way to pseudo-multitask


Adam Helberg
05-11-2007, 12:02 AM
I used to use a program called Carousel with DOS that could open a number of programs and store the state on the hard drive to quickly swap from one to another. I wonder if anyone else remembers this. DOS had the same problem with trying to multitask as Palm OS.

So instead of storing the state in RAM, I wonder if a carousel Palm program could be written to save the program state on the SD card (the Palm equivalent of the hard drive) and swap to another.

Adam

juggernaut#2
05-11-2007, 02:36 AM
PalmOS is able to multitask, as you can see i.e. when using a mp3-player. Itīs just that palm doesnīt disclose howto.

The New No. Two
05-11-2007, 10:08 AM
Carousel?

Let me guess... you had an HP200LX?

Greek
05-11-2007, 10:22 AM
PalmOS leaves its programs in the state you were just where you left. Say you have a Contact opened and were editing it and then you jumped to the calculator, when you get back to Contacts you will be at the editing contact with the data you already entered still there.

VersaMail (by retrieving messages with its scheduling) and all IM programs can run in the background, thatīs multitasking too, IMHO. :)

Regards,

potter
05-11-2007, 10:31 AM
Side bar:
PalmOS is able to multitask, as you can see i.e. when using a mp3-player. Itīs just that palm doesnīt disclose howto.Not completely true. The Palm OS micro-kernel is multitasking (http://www.access-company.com/developers/documents/docs/palmos/PalmOSCompanion/SystemFeatures.html#1046570); has been since 1.0. However, Palm has never exposed a general API that 3rd party developers could use. They do however expose a Sound Manager API which third party applications can use to write background audio players.

potter
05-11-2007, 10:50 AM
PalmOS leaves its programs in the state you were just where you left.According to the Palm OS User Interface Guidelines, that is the way that Palm OS applications are suppose to act. Alas it is the applications responsibility to save off their current state, so that they can restart to the same location. Alas, too many Palm OS applications do not fully implement this feature, including some of the standard PIM applications.

If all Palm OS applications properly implemented this feature, the need for multi-tasking would be greatly reduced.

Say you have a Contact opened and were editing it and then you jumped to the calculator, when you get back to Contacts you will be at the editing contact with the data you already entered still there.When was the last time you did this? With Contacts if I am editing a record and then launch the calculator, if I then relaunch Contacts I am then looking at the contact list; I am no longer editing that record.

Greek
05-11-2007, 12:30 PM
You are right, it sends you to the Contacts list but the data entered should be there. I use Memos a lot and in that case, I can return to the memo I was working in.

Sorry for the confussion. :)

Regards,

Adam Helberg
05-11-2007, 01:24 PM
PalmOS leaves its programs in the state you were just where you left. Say you have a Contact opened and were editing it and then you jumped to the calculator, when you get back to Contacts you will be at the editing contact with the data you already entered still there.

VersaMail (by retrieving messages with its scheduling) and all IM programs can run in the background, thatīs multitasking too, IMHO. :)

Regards,

If this were true there would be no need for Accessorizer and Sub-Launcher. While some apps do preserve the state many don't. The built-in address book doesn't. If I open a contact, then go to Applications, Calculator and come back to address book, the contact is closed.

The same applies to third party apps like Supermemo and Lingvosoft dictionaries and many others.

The DOS computer I had was a Mitsubishi portable with Black and White LCD screen. If I recall it had a 40 Meg hard drive, which I doubled with compression software.

Adam

phreakonaleash
05-11-2007, 01:51 PM
VersaMail (by retrieving messages with its scheduling) and all IM programs can run in the background, thatīs multitasking too, IMHO. :)

As for VersaMail: I am afraid you are wrong there. The PalmOS has an Alarm manager, and imho all that VersaMail does is set an alarm that would get the mail :) (And ResExplorer confirms this when I open op the alarm list) Technically this is not multitasking.

As for the IM clients: they are probably using the hede notifiication to react to some sort of net library event and then checking the tcp/ip packet to see if it belongs to them. Just my thoughts and the way the IM works, I may be 100% wrong :rolleyes:

My 0.04$

_Em
05-11-2007, 02:27 PM
So basicly, there is simple multitasking available if the software developers take advantage of it, but nothing at the OS level that is exposed to third parties.

Palm has created a number of threads in the OS, and has developed an API for each one. Those threads can all run at the same time (multitasking), but have to be invoked correctly to do it.

So, you can use the notification manager to trigger launch events that are outside the normal event loop, and you can use the audio manager to send audio outside the normal event loop. You can also use desk accessory handles that allow you to run multiple apps in the same memory heap.

The other thing I've seen (correct me if I'm wrong) is that PalmOS 5 only allows you to have 3 levels of windows.

phreakonaleash
05-14-2007, 02:11 PM
So, you can use the notification manager to trigger launch events that are outside the normal event loop, and you can use the audio manager to send audio outside the normal event loop. You can also use desk accessory handles that allow you to run multiple apps in the same memory heap.

_Em: DA's are nthing but code called from a DA launcher: an application that uses the notifications feature. So they really cannot be counted... :) And DA's may 'run in the same heap' but tehy do not have acces to anything that would be in that heap (ie they cannot use globals.) The except, of course is accessorizer, but that is another story :)

Adam Helberg
07-13-2007, 04:41 PM
I wonder why no one has written a Carousel program for Palm. It would look somewhat like PowerRun except it would save the state of the program onto the SD card when you swap to another, so when you come back you're return to the same place.

Adam

dkirker
07-13-2007, 09:33 PM
Yes, this function has been around since 1996. The developer must implement it because there are too many variations between applications.

pruss
07-14-2007, 10:11 AM
I wonder why no one has written a Carousel program for Palm. It would look somewhat like PowerRun except it would save the state of the program onto the SD card when you swap to another, so when you come back you're return to the same place.

Adam

It would be very hard to do right. For one, PalmOS is a multitasking OS, and background threads would surely get really badly screwed up. Since one couldn't practically swap the NVFS storage area, keeping the cache in sync would be just about impossible. In short, a modern PalmOS device is more complex than a standard DOS system.

Moreover, Palm devices have a lot more than 640K of memory, so a swap of all of memory would take quite a while, even though storage speeds have increased.

One would have more hope of making a supercharged version of Accessorizer, but that, too, would be really hard.

Tam Hanna
07-18-2007, 05:44 AM
Guys...the API may be released soon. Cant say more though!

alt236
07-18-2007, 07:19 AM
@Tam Hanna

You mean KADAK's multitasking API? That would be interesting (although a tad late).

Adam Helberg
07-18-2007, 08:07 PM
It would be very hard to do right. For one, PalmOS is a multitasking OS, and background threads would surely get really badly screwed up. Since one couldn't practically swap the NVFS storage area, keeping the cache in sync would be just about impossible. In short, a modern PalmOS device is more complex than a standard DOS system.

Moreover, Palm devices have a lot more than 640K of memory, so a swap of all of memory would take quite a while, even though storage speeds have increased.

One would have more hope of making a supercharged version of Accessorizer, but that, too, would be really hard.

You would not have to swap all the memory to the card, just the part related to the application to swap. The NVFS I'm not familiar with as my iQue does not have it.

By the way, Alex, the new version of Accessorizer, v.91, is the most stable so far on my iQue, as long as I stay away from applications that have a resident mode.

Adam