SOLVED

What is the standard COM and SendMessage pumping in Doc?

%3CLINGO-SUB%20id%3D%22lingo-sub-2939598%22%20slang%3D%22en-US%22%3EWhat's%20the%20standard%20COM%20and%20SendMessage%20pumping%20in%20Doc%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2939598%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20learning%20the%20%3CSTRONG%3EThread%20%3C%2FSTRONG%3Eclass%20to%20control%20the%20Thread%20manually%20in%20my%20application.%3C%2FP%3E%3CP%3EThe%20doc%20is%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fapi%2Fsystem.threading.thread.join%3Fview%3Dnet-5.0%23System_Threading_Thread_Join%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E%26nbsp%3B.%3C%2FP%3E%3CP%3EThere%20is%20an%20most%20important%20method%20while%20using%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EThread.Join()%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3BIn%20the%20Join%20method%2C%20this%20is%20a%20fragment%20of%20description.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3Ewhile%20continuing%20to%20perform%20%3CSTRONG%3Estandard%20COM%3C%2FSTRONG%3E%20and%26nbsp%3B%3CSTRONG%3ESendMessage%26nbsp%3Bpumping.%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20searched%20a%20lot%2C%20but%20I%20can't%20find%20any%20exact%20explanation%20of%20these%20two%20item.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2939598%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E.NET%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2939686%22%20slang%3D%22en-US%22%3ERe%3A%20What%20is%20the%20standard%20COM%20and%20SendMessage%20pumping%20in%20Doc%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2939686%22%20slang%3D%22en-US%22%3EThis%20is%20all%20about%20the%20low-level%20internals%20of%20the%20Windows%20system%20(Win32%20API).%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20OS%20deals%20with%20applications%20using%20a%20message%20queue%2C%20where%20applications%20cycle%20between%20asking%20the%20OS%20for%20new%20messages%20and%20dealing%20with%20them.%3CBR%20%2F%3EFor%20example%2C%20mouse%20movement%2Fclicks%2C%20key%20events%2C%20window%20changes%2C%20external%20events.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20your%20application%20stops%20consuming%20messages%20from%20the%20queue%2C%20the%20OS%20will%20assume%20that%20the%20application%20has%20hung%20and%20will%20eventually%20suggest%20to%20the%20user%20to%20kill%20it.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20doc%20is%20saying%20that%2C%20although%20you%20are%20holding%20up%20the%20current%20thread%20when%20you%20call%20%22Join%22%2C%20the%20framework%20will%20continue%20to%20deal%20with%20COM%20and%20OS%20messages%2C%20so%20that%20your%20application%20doesn't%20appear%20to%20hang.%20So%2C%20it's%20not%20something%20that%20you%20have%20to%20worry%20about%20too%20much%20-%20but%20that%20doesn't%20mean%20you%20can%20completely%20ignore%20where%20you're%20calling%20Join.%3CBR%20%2F%3E%3CBR%20%2F%3EAs%20an%20aside%2C%20Thread%20is%20still%20important%20in%20some%20places%2C%20but%20it's%20definitely%20more%20of%20a%20lower%20level%20concept%20nowadays.%20In%20production%20code%2C%20I%20would%20more%20expect%20to%20see%20people%20using%20the%20Async%20pattern%20for%20typical%20concurrent%20code%20usage.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2942199%22%20slang%3D%22en-US%22%3ERe%3A%20What%20is%20the%20standard%20COM%20and%20SendMessage%20pumping%20in%20Doc%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2942199%22%20slang%3D%22en-US%22%3EClear%20explanation!%3CBR%20%2F%3EI%20will%20use%20task-base%20pattern%20for%20my%20code%20with%20threadpoll.%3CBR%20%2F%3EThanks%20a%20lot.%3C%2FLINGO-BODY%3E
New Contributor

I am learning the Thread class to control the Thread manually in my application.

The doc is here .

There is an most important method while using it.

 

 

Thread.Join()

 

 

 In the Join method, this is a fragment of description.

 

while continuing to perform standard COM and SendMessage pumping.

 

I have searched a lot, but I can't find any exact explanation of these two item.

2 Replies
best response confirmed by NullReference (New Contributor)
Solution
This is all about the low-level internals of the Windows system (Win32 API).

The OS deals with applications using a message queue, where applications cycle between asking the OS for new messages and dealing with them.
For example, mouse movement/clicks, key events, window changes, external events.

If your application stops consuming messages from the queue, the OS will assume that the application has hung and will eventually suggest to the user to kill it.

The doc is saying that, although you are holding up the current thread when you call "Join", the framework will continue to deal with COM and OS messages, so that your application doesn't appear to hang. So, it's not something that you have to worry about too much - but that doesn't mean you can completely ignore where you're calling Join.

As an aside, Thread is still important in some places, but it's definitely more of a lower level concept nowadays. In production code, I would more expect to see people using the Async pattern for typical concurrent code usage.

Clear explanation!
I will use task-base pattern for my code with threadpool.
Thanks a lot.