Subject | Re: Issue for process |
---|---|
Author | Adam |
Post date | 2007-06-01T02:47:01Z |
--- In firebird-support@yahoogroups.com, "heroes3lover"
<heroes3lover@...> wrote:
---
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
there.
---
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.
Adam
<heroes3lover@...> wrote:
>From my prior post:
> 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
>
---
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
there.
---
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.
Adam