Linux and Windows
system threads, people familiar with WIN32 programming must know that WIN32 process management is very different from Linux, in Unix There is only the concept of process, but there is a concept of "thread" in WIN32, then what is the difference between Linux and WIN32 here? The process/thread in WIN32 is inherited from OS/2. In WIN32, "process" refers to a program, and "thread" is an execution "thread" in a "process". From the core, WIN32's multi-process is not much different from Linux. The thread in WIN32 is equivalent to the Linux process, which is a code that is actually being executed. However, WIN32 shares data segments between threads in the same process. This is the biggest difference from the Linux process. Under WIN32, use the CreateThread function to create a thread. Unlike the creation process under Linux, the WIN32 thread does not run from the creation point. Instead, a function is specified by CreateThread, and the thread starts running from that function. This program, like the previous UNIX program, prints 1000 messages each by two threads. threadID is the thread number of the child thread. In addition, the global variable g is shared between the child thread and the parent thread, which is the biggest difference from Linux. As you can see, the process/thread of WIN32 is more complicated than Linux. It is not difficult to implement a WIN32-like thread in Linux. As long as the fork is executed, let the child process call the ThreadProc function and open a shared data area for the global variable, but Under the WIN32 can not achieve the function of similar fork. So now the library functions provided by the C compiler under WIN32 are compatible with most Linux/UNIX library functions, but they still cannot implement fork. For multitasking systems, sharing data areas is necessary, but it is also a problem that is easy to cause confusion. Under WIN32, it is easy for a programmer to forget that the data between threads is shared. After a thread has modified a variable. Another thread modified it, causing a problem with the program. But under Linux, because the variables are not shared, the programmer explicitly specifies the data to be shared, making the program clearer and more secure. As for the WIN32 "process" concept, its meaning is "application", which is equivalent to exec under UNIX.
Today, I have brought the steps of adding static routes for Linux, I hope to help my friends! 1. Add
According to the US technology blog TNW, the well-known Linux vendor Canonical today released and de
Why should there be process priority? This does not seem to require too much explanation. After all,
I am getting error in make posix, prompt: make: cc: Command not found make: *** [posix] Error 127 so
Resolve VSFTP local users can not authenticate login problems
Possible problems with the nagios installation process
Linux tomcat cluster configuration case
Openoffice garbled solution under Linux
Linux modify user group method
The difference between several Linux kernel files
Explanation: When a segmentation error occurs, how does the Linux system generate the core file
Mandriva Linux Financial Crisis New investors reach out
Low-key literary lizard: remember SUSE Linux 20th Anniversary
Shell awk real-time monitoring network card traffic script (common application 2)
Two steps to install Windows 8 Consumer Preview with U disk
Verify Windows XP SP3 Improves Efficiency Truth
Can WinXP install .NET Framework 4.5?
What if the server CPU is full?
Win7 adjust disk partition size tutorial
Fixed favorites in Win7 Explorer could not be expanded
Win7 system accidentally delete the boot partition how to restore