MIDAS thread model in Delphi
(1)Single
The In-PRocess COM program represented by the generated In-PRocess COM program is a single thread program that can only receive requests issued by one client at a time. Since it is a loop operation, there will be no problem of multitasking at the same time. Your COM program does not need to Multiple writing
The part of the handling.
(2) Apartment
In other words, the instance generated by each Remote Data Module can only process requests issued by one foreground at a time. However, if multiple In-Process COM programs are created at the same time, each COM program will have a thread to process, each
The data processed by instance is safe, but you must prevent conflicts between some shared variables.
(3)Free
This thread mode allows each instance generated by the Remote Data Module to process the request issued by each foreground through its own thread. Therefore, the Remote Data Moudle itself must adopt multi-threaded program writing, and you must protect each
The data areas processed by each instance will not conflict with each other. When using ADO datasets, it is recommended to use the Free model.
(4)Both
Like Free, except that all callbacks corresponding to the front-end interface are continuous.
(5)Neutral
This mode allows multiple foreground programs to call Remote Data Module with different threads at the same time. However, the COM object must ensure that there will be no conflicts in the foreground program calls. You must determine that each thread is accessing global variables and instance data. ,No
Any conflicts will occur. This mode only applies to COM+.