Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Delphi + Hyperthreading problems

61 views
Skip to first unread message

Andy

unread,
Jul 22, 2004, 11:47:42 PM7/22/04
to
Hi All,
is there anything I need to do or beware of when writing a program which
will be used on a pc with a hyperthreading processor.

I have a program I wrote which works fine in XP with older processors but
refuses to run (ie get the send error report to MS message) on pc's with
late model processors.
If I disable the hyperthreading my program works fine.
Program is in D7pro/ ADO/ Access2k

Are there any compiler options etc I need to set.
Any help is appreciated.

Andy


ro...@ozsoft.com.au

unread,
Jul 23, 2004, 1:56:23 AM7/23/04
to
Andy wrote:

Hi Andy,

I don't know about Delphi in particular, but Interbase 6 has issues with
slow initial connection on multiple processor/hyperthreding processor
computers. It does work, just takes a little while. (There is a
regestry setting which can fix that also).

Lord Crc

unread,
Jul 23, 2004, 7:46:57 AM7/23/04
to
On Fri, 23 Jul 2004 13:17:42 +0930, "Andy" <An...@no.mail.please>
wrote:

>is there anything I need to do or beware of when writing a program which
>will be used on a pc with a hyperthreading processor.

Your program must be multithread safe, which it should be anyway.
However multithreading bugs seem to surface a lot sooner when you
actually got multiple cpus running the code.

So, if you got threads, make sure they're accessing things correctly.

- Asbjørn

Craig Stuntz [TeamB]

unread,
Jul 23, 2004, 8:18:18 AM7/23/04
to
ro...@ozsoft.com.au wrote:

> I don't know about Delphi in particular, but Interbase 6 has issues
> with slow initial connection on multiple processor/hyperthreding
> processor computers. It does work, just takes a little while.

I'm close to certain this won't be the cause of the problems he's
experiencing with his Access 2000 app.

-CRaig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Please read and follow Borland's rules for the user of their
news server: http://info.borland.com/newsgroups/guide.html

Dan Downs

unread,
Jul 23, 2004, 10:47:15 AM7/23/04
to
> I have a program I wrote which works fine in XP with older processors but
> refuses to run (ie get the send error report to MS message) on pc's with
> late model processors.
> If I disable the hyperthreading my program works fine.
> Program is in D7pro/ ADO/ Access2k
>
> Are there any compiler options etc I need to set.
> Any help is appreciated.

Older versions of the JCL/JVCL had issues with hyperthreaded cpus. Could be
a component pack that is detecting cpu speed/specs/etc..

DD


softcoder

unread,
Jul 23, 2004, 11:48:26 AM7/23/04
to
I wrote a real-time daytrading app in BCB5 a couple years ago. First
customer that had hyperthreading and first customer that had
multi-processors revealed missing critical sections and mutexes are the
access of shared data in my threads. This was the primary reason for all the
problems I had expereinced and was finally resolved after careful logging
etc..

"Andy" <An...@no.mail.please> wrote in message
news:41008a83$1...@newsgroups.borland.com...

Martin Harvey (Demon Account)

unread,
Jul 23, 2004, 2:13:26 PM7/23/04
to
On Fri, 23 Jul 2004 13:17:42 +0930, "Andy" <An...@no.mail.please>
wrote:

>Hi All,


>is there anything I need to do or beware of when writing a program which
>will be used on a pc with a hyperthreading processor.

Yes - there are potential issues with resource starvation between the
two threads scheduled to run on a single CPU. Basically, if one of the
threads busy waits (even doing a sleep(0) or "yeild"), then it can
cause serious performance problems for other threads scheduled on the
CPU.

>I have a program I wrote which works fine in XP with older processors but
>refuses to run (ie get the send error report to MS message) on pc's with
>late model processors.

This looks more like changes made to modern CPU's to improve security
requirements. ISTR someone mentioning something in some groups about
running a program in "windows 95 compatibility mode" ?? Just a
thought.

>If I disable the hyperthreading my program works fine.

If you can find an O.S switch to get that particular program to run,
rather than completely disablibg hyperthreading that would probably be
preferable.

MH.

Andy

unread,
Jul 23, 2004, 4:55:10 PM7/23/04
to
Hi Dan,
I think you may have hit the nail on the head - I do use jvcl 2.1
I made a small sample app and as soon as I added any jvcl data-aware
components the problem occurred.

Will try installing jvcl 3 and see if that solves the problem.

Thanks
Andy
"Dan Downs" <ddo...@nospam.online-access.com> wrote in message
news:410124f5$1...@newsgroups.borland.com...

Robert Rossmair

unread,
Jul 25, 2004, 5:54:03 PM7/25/04
to
Hi,

Andy wrote:
> Hi Dan,
> I think you may have hit the nail on the head - I do use jvcl 2.1
> I made a small sample app and as soon as I added any jvcl data-aware
> components the problem occurred.

The cause of the problem is JclSysInfo.GetCpuSpeed, which is
(needlessly) called during JclGraphUtils initialization.

The most simple fix is to replace the first instruction in
JclGraphUtils.SetupFunctions:

// GetCpuInfo(CpuInfo);
CpuInfo := CPUID;

so that GetCpuSpeed won't be called there.

Note: This bug is fixed (among many others) in the latest JCL release 1.91.

Greetings, Robert

Andy

unread,
Jul 25, 2004, 6:54:04 PM7/25/04
to
THANKYOU Robert,
That fixed the problem.

Andy
"Robert Rossmair" <Robert....@gmx.net> wrote in message
news:4104...@newsgroups.borland.com...

Andrew

unread,
Jul 25, 2004, 11:42:56 PM7/25/04
to

> I don't know about Delphi in particular, but Interbase 6 has issues
> with slow initial connection on multiple processor/hyperthreding
> processor computers. It does work, just takes a little while.
> (There is a regestry setting which can fix that also).

Hi Robin,

You don't know the specifics of that Registry setting do you? My team
is about to migrate our IB6 app to Firebird because of the slow connect
issue. A fix would let us put off the migration indefiitely...

Thanks,
Andrew

ro...@ozsoft.com.au

unread,
Jul 26, 2004, 12:36:33 AM7/26/04
to

Hi Andrew,

Before I progress, I am not an expert!

The file (A registry edit) is located on the below link with a brief
explanation

http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=16665

What this does is specify which processor (Or virtual processor with
HyperThreading) for Interbase to use. It fixes this issue on NT4 or
better OS.

I hope this helps!

Robin.

Andrew

unread,
Jul 26, 2004, 9:05:10 PM7/26/04
to
ro...@ozsoft.com.au wrote:

> Hi Andrew,
>
> Before I progress, I am not an expert!
>
> The file (A registry edit) is located on the below link with a brief
> explanation
>
> http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=16665
>
> What this does is specify which processor (Or virtual processor with
> HyperThreading) for Interbase to use. It fixes this issue on NT4 or
> better OS.
>
> I hope this helps!
>
> Robin.

Yes, it does! Thanks.

Cheers,
Andrew

0 new messages