Core object

zhaozj2021-02-16  76

First let me explain what is called "core object". "GDI object" is something familiar to everyone, and we use a pen (PEN) or brush (brush) generated by GDI functions to be called "GDI object." But what is "core object"?

You can say that the core object is a resource of the system (Hey, this statement applies to GDI objects), once the system object is generated, any application can turn on and use this object. The system gives a core object as a count value for administration. Core pairs include the following:

Nuclear

Birthplace

Event

CreateEvent

Mutex

Createmutex

Semaphore

CreateSemaphore

File

Createfile

File-mapping

CreateFilemapping

PROCESS

CREATEPROCESS

Thread

CreateThread

The top three is used for the synchronization of threads: file-mapping objects are used for memory mapping files, and the Process and Thread objects are the protagonist of this section. The way these core objects are different (that is, the API we use) is different, but it will get a handle as an identification; every time it is used, the corresponding count value plus 1. The end of the core object is quite consistent, and CLOSEHANDLE can be called.

What is the "Process object" to do? It is not as if you imagined, it is used to "execute program code"; no, the execution of the program code is the work of the thread, "Process object" is just a data structure, and the system uses it to manage the process.

转载请注明原文地址:https://www.9cbs.com/read-16192.html

New Post(0)