TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Lars Hellsten
from: Mike Bilow
date: 1996-01-03 06:57:36
subject: Swapping to disk?

Lars Hellsten wrote in a message to All:

 LH> I'm using Virtual Pascal and trying to port one of my
 LH> programs over to OS/2. So far all has gone better than I
 LH> expected, but one of the couple of problems I've run into so
 LH> far is swapping to disk to execute external programs.  In
 LH> the DOS version, I've been using Turbo Power's ExecSwap.

 LH> I know under OS/2 I technically don't have to free up the
 LH> memory the program's using, but I would prefer to not have
 LH> the program sitting in memory while the external program is
 LH> run, so if anyone has any ASM/Pascal code for swapping to
 LH> disk under OS/2, or can offer any useful information here, I
 LH> would really appreciate it.

Except in very rare cases, such as when you are writing a program to be
used during the installation of the operating system, it is bad practice to
try to manage swapping yourself.  For one thing, OS/2 code segments are not
swapped into the swap file, but are discarded and reloaded directly from
the EXE.  This is in contrast to DOS, since OS/2 code segments are never
modifiable (unless they are explicitly aliased by data selectors).  Still
worse, by touching uncomitted memory space in order to swap it privately,
you will force the operating system to commit that memory and possibly slow
things down by orders of magnitude.  Finally, even if you get it to work,
the operating system uses the hardware to keep a global record of which
segments are least recently used and are therefore the best candidates for
swapping; it is impossible for your process to have such a perspective.
 
-- Mike


--- 
* Origin: N1BEE BBS +1 401 944 8498 V.34/V.FC/V.32bis/HST16.8 (1:323/107)
SEEN-BY: 270/101 620/243 711/401 409 410 413 430 808 809 934 955 712/407 515
SEEN-BY: 712/517 628 713/888 800/1 7877/2809
@PATH: 323/107 150 3615/50 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.