Video: The iPhone 3G might be able to multitask in OS 4.0 after all.. if it's jailbroken

Never ones to let Apple’s work go untested, the jailbreak community has just put to the test Apple’s claims that the iPhone 3G (as compared to the iPhone 3GS) couldn’t handle the multitasking functionality introduced in iPhone OS 4. As it turns out.. it can — but don’t prep the torches and pitchforks just yet.

As you can see in the video above, the always-so-damned-impressive hackers were able to jailbreak iPhone OS 4.0 running on an iPhone 3G, modify a .plist file – and bam! Multi-tasking support on a 3G. Watch in wonder as they switch between calculator and settings.

Warning: Things get wordy from here on out.

Here’s the catch: calculator, settings, and any other apps that can easily be tested at this point (in other words, Apple’s apps) aren’t really suited for testing this. Third party applications — especially the more intensive ones — are going to be the real determining factor here, and those sorts of apps have to be rebuilt against the 4.0 SDK before they’ll play friendly with the new multitasking system. 4.0 apps aren’t available in the App Store for obvious reasons.

You see, the way Apple is doing multitasking is a bit tricky; outside of a few select APIs (turn-by-turn nav, audio streaming, downloading/uploading, etc.), most apps won’t actually be running in the background. When the user presses the home button, iPhone OS takes an instant snapshot of the entire application and all of its data, then stores the snapshot away. When you switch back to that application, the snapshot almost instantly springs back to life, appearing as if it had never closed. It’s win-win: the user gets ultra quick application switching, and the iPhone doesn’t have to allot resources like RAM and CPU to applications that have no reason to be running.

Storing all that stuff instantly and then resuming it just as quickly is the hard part. Apple gives developers very little time to pause their applications on command — and the amount of time allotted is constantly changing, based on the resources available. The more intensive the app currently running is, the less CPU/RAM is available, the less time iPhone OS gives an app to pause in hopes of getting its resources as soon as possible. If the process can’t be paused in time, the application gets shut down.

Now remember: the iPhone 3G has less CPU and RAM than the 3GS (412 Mhz CPU/128 MB Ram vs. 600 Mhz/256 MB). Less resources from the get go = less time to pause = more apps being shutdown rather than paused. Apple’s options here: let applications take longer to pause/resume on the 3G and thus break the entire smooth, invisible pausing/unpausing system they put in place, or don’t let them pause at all.

They chose the latter for the time being. Right choice? Wrong choice? That’s up to you to determine. Let me know in the comments below.

[Video via RedmondPie]