Subject Re: Issue for process
Author Adam
--- In, "heroes3lover"
<heroes3lover@...> wrote:
> I have finished code to use multithread to access firebird,
> but not satified with the testing result.
> Is there any settings I should pay attention?
> Thanks,
> Roc

From my prior post:

Use OutputDebugString in the windows unit to send messages from within
your thread. Download DebugView from Microsoft (formerly sysinternals)
and you can watch what is happenning. You are doing synchronise to
write your logs at the moment, which is going to put a bottle neck in

Your logging mechanism is a massive bottleneck. You are not going to
get good performance while you have all those synchronise calls. Every
time you synchronise, your thread has to wait for the main thread to
wake up, process its message queue, then sleep again.

Either write your own threadsafe logging queue that can buffer the log
messages without holding up your threads, or do what I suggested and
replace your Synchronise calls to OutputDebugString calls and let
Windows take care of it.

Once you have eliminated that as a problem, you can then move onto
what resource is actually being thrashed or underutilised, playing
around with cache sizes etc.