The main reasons are The processing application receives these requests in a TCP connection; and the sending application sends them at a rate of 500 per second.
So I need to receive this request then go back and listen for the next one as the request is processed by the dll; instead of receive > process > reply > wait for next; because when I get to the "wait for next stage" the sending application might have already send 1000 or so messages, most of which I have already missed! More like receive > process in thread > wait so that I can go back and wait as soon as I can. And the thread is charged with the responsibility of reply Jangita. http://www.jangita.com mailto:[EMAIL PROTECTED] -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, August 16, 2005 9:09 AM To: [email protected] Subject: Re: [delphi-en] DLLs and Threads > Chris @ IT wrote: > > I have this application that loads DLL's dynamically as plugins and as such > > I use the loadlibrary, getprocaddress, free library routines. > > > > The host application loads the dll and calls its process export function so > > that the dll can do what its meant to do. The problem is there are usually > > many requests to be done (about 500 every second) and when I call the dll > > for each sequentially its takes quite a bit of time > > > > What I want to try is spawn a new thread that loads the dll and calls the > > function. With this approach the dll will be loaded many times and its > > function called many times. Hi Chris, what makes you think, the bottleneck can be the amount of executable code in the DLLs? Loading two DLLs which provide two different functions to two different threads will not run faster than one DLL with both functions in it. The point you are thinking about is: How is the CPU-time shared between these both treads. Well, that is something you may influence. the Sleep function at least gives the remainder of the current time-slice to other threads waiting for execution and last, but not least there is something named a process-priority which can be lowered easily. putting sleep(0) calls into the right places of the long enduring function may to the task already. Tampering with the priority can affect overall system performance, so be careful! have fun Bob ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h1iuumd/M=362329.6886308.7839368.1510227/D=groups/S=1705115362:TM/Y=YAHOO/EXP=1124181081/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992 ">Fair play? Video games influencing politics. Click and talk back!</a>.</font> --------------------------------------------------------------------~-> ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/delphi-en/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

