Click to See Complete Forum and Search --> : suspending applications


martin2002
October 1st, 2005, 08:59 PM
hi to all... :wave:

how hard is it to suspend a single application to disk an restore it later (os: windows xp)? (like the built in suspend functionality in windows xp - just on app layer)

i mean getting a dump of the application memory might not be that hard, right?
but what i've to do to restore it? writing the data back into memory... okay. but how do i recreate the app thread, windows, classes, etc.?

are there already solutions for such processes?

you may find i'm a bit crazy :blush:, but i find that's the best way to switch between different workspaces (development, video auth., gaming, entertainment - you know what i mean?) for doing something else and afterwards going back to the last work... any better (or easier) ideas?

thx
martin

Pinky98
October 5th, 2005, 04:38 PM
WOAW. There is just WAY too much data store in various places to attempt take successfully... well its not impossible just REDICULOUSLY hard.

e.g. If you're going to attempt this then you're going to have to store the CPU registers too. And to get those you'll need to goto to the assembler level. Most noticably you're gonna have to store the pc counter and be able to restore this, plus the way the cpu's are designed to run code (e.g. path expectation etc) makes this damb near impossible.

Dam cool idea though. I would love to get something like that.

Marc G
October 6th, 2005, 05:05 AM
Personnaly, I'm certain this is impossible.

Just think about it for a second. Suppose you want to restore your application and suppose your application had some windows, files, semaphores, threads, ... open. Suppose further you have already started some other applications. When you want to restore your app now, it is highly possible that there will be collisions with window handles, file handles, thread IDs etc. How would you solve this? You can't change a thread ID of a running thread, you can't change file handles, window handles, .... Also, the application being restored might have some local variables that store things like window handles, file handles etc. So IF you somehow (highly unlikely (read impossible)) manage to change the window handle, file handle... because it collides with another handle already active, how are you going to update the local variables to reflect this change? Simply put: impossible unless you know the source code of the application and if you have the source code of the application you could implement the suspend-to-disk in the source itself.

To go even further, like Pinky98 said, you'll also need to store CPU registered, pc counter etc. However, Windows is a multitasking operating system, so you can't just get the registers, PC counter from the CPU itself, because that might be of another process that is currently active. So, you need to now the extreme details of Windows to know where registers, pc counters etc are stored for each process.

Bottom line: the idea sounds extremely cool, but it's not possible.

Marc G
October 6th, 2005, 05:13 AM
As a side note: Have you considered using Fast User Switching of Windows XP?

martin2002
October 13th, 2005, 08:00 PM
yeah i considered using fast user switching. but i'd not like it... to many user names for auth in my local network... (maybe i'll integrate the pc into our local domain) and processes running under other user names are still active and taking away some memory...

well, i didn't thougt it would be easy... i'd even try this, if i had more time... but there isn't much. so i gonna try VMWare to set up several machines on my pc and i'll install several systems on them and then i'll use the suspend function of the system.

nevertheless we could tell the idea to ms... maybe they include something like that in future releases.

thx
martin

Pinky98
October 13th, 2005, 08:34 PM
nevertheless we could tell the idea to ms... maybe they include something like that in future releases.
What?? Microsoft actually put in a feature that could be useful? Are you mad? But, how about a fluffy dog that can run around your screen and let you know that you are writing a letter or that it can look for files for you!! Now THAT is worth investing development time for!

I think the only way you'll see this feature creep in, is if it is a random side effect of some bug.

Marc G
October 14th, 2005, 05:13 AM
I highly doubt we will ever see such a feature because of the fact that it's quite impossible to do it right.

martin2002
October 14th, 2005, 07:21 AM
What?? Microsoft actually put in a feature that could be useful? Are you mad? But, how about a fluffy dog that can run around your screen and let you know that you are writing a letter or that it can look for files for you!! Now THAT is worth investing development time for!

I think the only way you'll see this feature creep in, is if it is a random side effect of some bug.

you'r so right... i forgot that :D

I highly doubt we will ever see such a feature because of the fact that it's quite impossible to do it right.
hey ms is the system developer ... and if they plan to implement that they'll find a way... maybe by changing some architecture of their sys

Marc G
October 14th, 2005, 07:29 AM
hey ms is the system developer ... and if they plan to implement that they'll find a way... maybe by changing some architecture of their sys
You mean a complete overhaul of there entire Windows architecture in which they somehow get rid of concepts such as window handles, file handles, ... ;)

martin2002
October 15th, 2005, 06:19 AM
yep... we'll never see those changes, but i'm sure they can do it if they really want... :D

okay... that's it. for now i'll try VMWare...

thank you all for your help and for bringing me back to reality ;)

Marc G
October 17th, 2005, 03:16 AM
thank you all for your help and for bringing me back to reality ;)
No problem :)

Pinky98
October 17th, 2005, 08:05 AM
no prob