Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Page 2 of 2 1 2
#121171 26/10/03 10:58 PM
Joined: Mar 2003
Location: Netherlands
addict
Offline
addict
Joined: Mar 2003
Location: Netherlands
Quote
This isn't true - it WOULD be true of a cooperative multitasking system, but not of a preemptive one. You can verify this by writing a program that just sits in a loop. You can still alt-tab away from such a program, which proves that the operating system can preempt a running thread that is in a loop. The "preemptive" name tag means that the OS will do exactly that.

It's not what I meant, I took a bit of a short cut here, so here's the lengthy version. Windows 3.1 was a cooperative multitasking system. If you never released your task then you could lock up the system, as you also state.
A preemptive multitasking system, of which Windows NT was the first Windows version to use it, uses timeslices. All threads with the same priority have the same timeslice and they all get the same amount of time to do their thing. Threads with a higher priority have a bigger timeslice. Threads with a lower priority have a smaller timeslice. Priorities range from 1-31 in Windows, with 31 being the highest. So a thread running with priority 31 would have a very big timeslice compared to a 'normal' thread that runs on priority 15.
If in your example the thread runs in a loop on priority 31, then your system can be considered to be dead. Eventhough all other threads will get some time. The amount of time they get is so minimal, that it would take too long to ever detect the ALT-TAB key being pressed (several minutes, which is beyond my patience level <img src="/ubbthreads/images/graemlins/winkwink.gif" alt="" />).
Threads can release the remaining part of their timeslice by becoming 'idle', like waiting on an event.

I doubt Divinity is running on priority 31, as it would be an insane thing to do. But as it takes aways so much processing power it either is running at a too high priority, causing it to be given too many processing time, or isn't blocking itself.


See me @ The Locus Inn & RPGWatch
#121172 23/12/03 03:18 AM
Joined: Dec 2003
S
apprentice
Offline
apprentice
S
Joined: Dec 2003
Hit the windows button... should get out of the game and allow you to do some other things... I don't think it auto pauses your game though... Alt-tabbing didn't work for me.. So the windows button had to do...If I could alt-tab out of Unreal 2, I sure as hell should be able to alt-tab a 2d rpg!

Page 2 of 2 1 2

Moderated by  Larian_QA, Lynn, Macbeth 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5