 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
G. Plante Guest
|
Posted: Fri Jan 06, 2006 5:57 am Post subject: Accessing a database from a thread VS Hyper-Threading on Win |
|
|
Hi,
I have a Delphi 7 program that access a database using the dbexpress
Interbase driver. The main program has a SQL Connection to the database. I
also have a thread that run in background and this thread has its own SQL
connection to access the same database. This thread access the database
every 5 seconds and only read some generators to see if changes were made to
the database.
This program always worked fine on a lot of pcs with Windows XP no matter if
Hyper-Threading is ON or OFF.
However, I got a new pc some days ago (with XP French installed on it). My
program stop working on this pc if Hyper-Threading is turned ON. If I turn
Hyper-Threading OFF on that pc, everything work fine. There is no error
message displayed on screen. It's like the thread stop or wait for
something.
If I modify the program and don't start the thread in background, my program
work fine on that pc even if Hyper-Threading is turned ON. Problems begin
when the thread in background is running.
What could be the problem ?
Thanks!
--
G. Plante
[email]gplante (AT) videotron (DOT) qc.ca[/email]
|
|
| Back to top |
|
 |
Craig Stuntz [TeamB] Guest
|
Posted: Fri Jan 06, 2006 12:23 pm Post subject: Re: Accessing a database from a thread VS Hyper-Threading on |
|
|
G. Plante wrote:
| Quote: | If I modify the program and don't start the thread in background, my
program work fine on that pc even if Hyper-Threading is turned ON.
Problems begin when the thread in background is running.
What could be the problem ?
|
Probably you have a bug in your thread where it incorrectly shares
data with another thread. Multi-threading bugs are much, much, *much*
more likely to surface with multiple CPUs, and this includes
hyper-threaded single processors.
There's not enough info in your post to speculate what the problem
might be, but make sure you're not sharing *anything* between the main
thread and the background thread and that the background connection is
never connected to a visual component in any way.
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Useful articles about InterBase development:
http://blogs.teamb.com/craigstuntz/category/21.aspx
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|