Re: [AD] Can somebody elaborate on lock_bitmap?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Grzegorz Adam Hankiewicz <gradha@xxxxxxxxxx> wrote:

> I read the description of that function and I think it is meant to be used
> in dos interruption context, but it's a guess. Could somebody elaborate
> it's description with at least a possible example? 'very weird things' is
> slightly helpless :)

your assumption is correct. this function tells the DPMI server that the
memory used for the bitmap should be locked in physical memory so that it is
not swapped out to disk. swap-in events are dangerous in an interrupt. it
might lead to lock-ups, disk corruption or slowdowns depending on the
operating system running. old DOS interrupts wasn't designed to be
re-entrant so disk access during an interrupt can have unknown consequences.
another thing is that if you access swapped out memory in a timer which is
set to execute very often the stack might overflow and the program will
crash. this is more likely with a 16-bit real mode application than for
32-bit protected mode applications since the stack is so big that a single
swap-in will likely be able to finish before the stack blows.

-henrik




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/