UI Thread better than Worker thread for speed? 
Author Message
 UI Thread better than Worker thread for speed?

Hi to all!

We're writing a DLL (MFC user dll, C-style API) which works as
communication module between clients (the apps) and several servers (OLE
servers, HOST programs, ...).
Some application calls must be dispatched to one of the servers, another
calls to 2 different servers. Because the actions done on serverside will
take some time, a parallel access to the servers in different threads would
be best - one thread for every server connection.

This sounds as a typical use of so-called worker threads. So we would have
to call AfxBeginThread() for every server we wanna talk to in every
exported function of our DLL.

Another solution would be to create the threads in DllMain for the whole
lifetime. In this case they should have a message loop (UI-threads). So I
could post private messages to those threads on every call.

Of course, in either case I must synchronize the return of the different

My question is whether it makes sense to create UI-threads (but without any
user interaction) to save the thread creation time on every call. How long
does it take to create a new thread comparing to the time of
thread-switching and the call to the servers themselves (0.5 - 5 sec)?

thanx, Mirko

Wed, 28 Jun 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. worker thread to ui thread

2. Starting a UI Thread from a UI Thread.

3. Worker and UI threads

4. Doubt in dialog based threads in linux (UI threading)

5. MFC UI Thread doesnt start when COM method called in multi-threaded MFC dialog App

6. Doubt in dialog based threads in linux (UI threading)

7. Awakening the UI thread from another thread in a Windows Form application

8. worker thread vs main thread?

9. COM Threading Model for ISAPI Worker Threads

10. Handling events from a worker thread in the main thread

11. component in main threads used in worker threads

12. Exe server threading model - events from worker thread question


Powered by phpBB® Forum Software