Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Apartment Model Threading
Message
From
15/08/1999 09:33:23
 
 
To
15/08/1999 08:50:02
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00252574
Message ID:
00253849
Views:
23
>I, too, was going to respond to Barbara similarly to yours, but then it occurred to me that the OS (Win in our case) has to be designed to handle such "wait states" appropriately. Personally, I have never heard of anything except timeslicing in relation to Win. This *could* mean that Win would simply continue to wait out the slice even in the (non)event of a wait state in the currently dispatched program. Do you happen to know more details (or even have some observations that suggest more smarts than this in Win)???
>

While Win32 uses a 'timeslice' concept, a thread has the ability to release control back to the operating system pending an event - hardware or software; there's nothing preventing cooperative multitasking, and in fact, there are several APIs that allow a thread, fiber or process to release their allotted time until one or more event occurances are signalled (you might want to look at the assortment of WaitFor Win32 API calls to see the variety of ways that a thread can avoid needlessly burning cycles while waiting for something to happen.)

A timesliced strategy to preemptive multitasking doesn't prevent the operating system from allowing or even encouraging cooperative multiprocessing. You might want to read Jeff Richter's Advanced Windows, chapters 2, 3 and 9 deal with process and thread strategies and thread synchronization, the first few pages of Chapter 10 on Windows messages have a very concise and descriptive summary of how multitasking and asynchronous events are handled (the majority of Chapter 10 deals with Windows Object messaging in general.

>Cheers
>
>Jim N
>
>>>
>>>Any CPU can handle only one task at a time and must use time slicing to handle multiple tasks. IOW, it's not a VFP limitation, it's a CPU limitation. I have no first-hand experience with multiple processors, but have heard horror stories from those who have.
>>
>>Not necessarily. You may have a thread which does some disk/floppy/other HW operation, and these may use little processor time, so if it happens in a separate thread, the original thread may keep singing almost undisturbed. It doesn't have to wait for the HW issues to get done, so there's still some gain.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform