-------------------------------------------------- ------------------------------ "Collaborative Multi-Task", "Take a Multi-Task", "Multi-Process", " Multi-threaded "These words can really be as thunder, but the word is the word, understanding is to understand, two things. I have explained a "multi-process" to a classmate, what is "multi-thread", what is "multi-thread", I have found that my explanation is completely wrong, so now I want to talk about the beta2 version, what is wrong, please put forward. Let me talk about "collaborative multitasking" and "preemptive multitasking". In Windows 3.1, multi-tasking way is "collaborative multitasking", meaning that a task gets a CPU time unless it will give up the CPU, otherwise it will completely account for the CPU, so it is necessary to collaboration between tasks - use for a period of time The CPU, give up the use, and other tasks, so that the normal operation of the system can be guaranteed; and in Windows 95 is "preemptive multitasking", its total control is in Windows, Windows will take turns to ask each one. Whether the task needs to use the CPU, let it use, but after a certain period of time, Windows will deprive the CPU usage right of the current task, and put it in the last task of the queue, then ask the next task ... Different in this approach causes 95 and 3.1 performance different: 3.1 If there is a task deadlock, the system is also deadlock; 95 has a task deadlock, and the system can still run. Let's talk about "multi-process" and "multi-thread". Multiple running copies of the same program is "multi-process"; in Windows 95, a process is just a subscription of a placement, only the thread is the truly running task, so a process contains at least one thread, in fact, The system creates a default thread for each process, called the main thread, the main thread can create a sub-thread, and the sub-thread can still create a sub-thread, which is "multi-thread". Windows treats threads is a task that is considered as a task. It does not have any discounts for the main thread, this is slightly different from OS / 2: Windows Under the next process, only one thread is not terminated, but in OS / 2 At the end of the next main thread, close all sub-threads simultaneously. There is a colleague very much on this thread management method of OS / 2, but I don't think of it, I think that the end of the thread will be better than the mandatory. Windows 3.1 is the concept of "multi-thread", because there is no meaning, only in the "multitasking multitasking" mode, "multi-thread" has its own use. "Hello World" of "Multithread" is a file replication. When a large file copy is made, although there is a "cancel" button on the replication form, but if it is not a multi-thread, only the program is reached, and the program knows that the user presses the "cancel" button, the typical first-play, not I want it too. Of course, it is not completely solved. In VB, it is "doevents" in VB. It is "PeekMessage", but this is really a dangerous approach in "Collaborative Multiking" - this function does not know when to return However, hardware is not taste, so there is only no way, let alone even in "preemptive multitasking", the efficiency is also very low. And use "multi-thread", you can use a thread to perform "crazy copy", a thread monitor button status, when the user presses the "Cancel" button, the program can know immediately, and immediately "cancel".