Board index » delphi » D2006 Hyperthreading Win32
Mike
![]() Delphi Developer |
Mike
![]() Delphi Developer |
D2006 Hyperthreading Win322006-01-26 04:45:32 PM delphi50 Hi I have Delphi 6 are we run into problems with servers using hyperhtreading. I saw that someone had raised the same issue with D7. All I want to do is complie into Win32 we use visual studio and C# for net stuff. Have borland fixed this isue in D2006 and it that the right version to be using for only win32 development. Thanks Mike |
Kristofer Skaug
![]() Delphi Developer |
2006-01-26 05:03:21 PM
Re:D2006 Hyperthreading Win32
Mike writes:
QuoteHave borland fixed this isue in D2006 and it that the right version I've been deploying many multithreaded Delphi 6 apps on HT machines, and while there have been some 'surprisees', these have not been attributable to fundamental problems with Delphi 6 itself! If you're doing Win32 only you can safely use D6, but I'd recommend installing the free replacement memory manager FastMM4 (fastmm.sourceforge.net, IIRC) which improves performance of multithreaded apps. But even that isn't strictly necessary. Furthermore I would of course recommend using Delphi 2006 just for the general improvements it brings to the table. But none of those are directly addressing HT issues, AFAIK. -- Kristofer |
Piotr Szturmaj
![]() Delphi Developer |
2006-01-26 09:10:21 PM
Re:D2006 Hyperthreading Win32QuoteI have Delphi 6 are we run into problems with servers using hyperhtreading. I |
Mike
![]() Delphi Developer |
2006-01-26 09:22:00 PM
Re:D2006 Hyperthreading Win32
No only machines that are using hyperthreading then memory usage can go out
of control get very high and the server will fall over. On non hyper threaded machines this does not happen. "Piotr Szturmaj" <XXXX@XXXXX.COM>writes Quote>I have Delphi 6 are we run into problems with servers using hyperhtreading. |
Francois Malan
![]() Delphi Developer |
2006-01-26 09:41:50 PM
Re:D2006 Hyperthreading Win32
Mike writes:
QuoteNo only machines that are using hyperthreading then memory usage can environment. -- |
Bernhard Geyer
![]() Delphi Developer |
2006-01-26 10:15:25 PM
Re:D2006 Hyperthreading Win32
D6 haven't no general problem with HyperThreaded/MultiCore-CPUs.
I think some of the used Controls/Components have problems. But this isn't a general Delphi-Problem. Some years ago we have problems with VS-Application (AFAIK Visual Studio 5/6) we get TCP/IP-Problems when more than one CPU is used by Windows. We solved this by "binding" the process to one CPU. Mike schrieb: QuoteNo only machines that are using hyperthreading then memory usage can go out |
Liz
![]() Delphi Developer |
2006-01-27 12:22:13 AM
Re:D2006 Hyperthreading Win32
Mike writes:
QuoteI have Delphi 6 are we run into problems with servers using controlling the thread, what once was in your control no longer is. I had issues with the Indy Telnet control in this senario. I told it I wasnt in a threaded environment, as it wasnt, and under this cercomstance, it went mental with HT. The VCL has never been deemed "thread safe" specifically, so I guess, if you've ever called application.processmessages or so on, now you may feel the pain. -- Liz the Brit Delphi things I have released: www.xcalibur.co.uk/DelphiThings |
Piotr Szturmaj
![]() Delphi Developer |
2006-01-27 01:45:24 AM
Re:D2006 Hyperthreading Win32QuoteNo only machines that are using hyperthreading then memory usage can go issue, when 2 cpu's have write access to the same object. While one cpu can run one thread at once HyperThreaded cpu can run 2 threads simultaneously. regards Piotr Szturmaj |
Craig Stuntz [TeamB]
![]() Delphi Developer |
2006-01-27 01:49:11 AM
Re:D2006 Hyperthreading Win32
Francois Malan writes:
QuoteThe RTL MM is known to "mismanage" memory in a threaded it slows down. I am unfamiliar with the old MM causing the problems described -- and I do a good bit of multi-threaded code. Do note that you must set IsMultiThread TRUE when using the old MM and threading, but that TThread does this for you if you use it. -- Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz All the great TeamB service you've come to expect plus (New!) Irish Tin Whistle tips: learningtowhistle.blogspot.com |
Captain Jake
![]() Delphi Developer |
2006-01-27 01:59:24 AM
Re:D2006 Hyperthreading Win32
"Mike" <XXXX@XXXXX.COM>writes
QuoteHi component. Something is not written or designed properly for multithreaded use. You may be able to run away from this problem for a while by updating to a decent memory manager like FastMM4 (which is the default memeory manager in D2006, but can be used in Delphi 6 applications also), but the real problem may be the way your app handles resources and objects. Eg, in a multithreaded environment you need to minimize the amount of time you hold on to resources and memory. |
Danijel Tkalcec [RTC]
![]() Delphi Developer |
2006-01-27 02:37:33 AM
Re:D2006 Hyperthreading Win32
If your code is thread-safe, it will run nicely on any PC (single cpu,
hyperthreading and dual-core). Writing thread-safe code means making sure that all of your threads (including the main thread) will be able to run at the same time, without getting to a situation where more than one thread will try to write to a memory location which is being used by some other thread (either reading from or writiting to it). Memory (objects, properties, variables, etc) is the one thing you need to take care of when writing multithreaded apps. One memory location may either be written to from one thread, or read from any number of threads. But, you may not write to the same memory location from more than one thread at a time, nor write to a memory location from which another thread is currently reading. In other words, memory is a single-write or multiple-read resource. Also, only the Main Thread may access the GUI, which means that you need to synchronize all events which need to access the GUI with the Main Thread. -- Danijel Tkalcec - Team RTC www.deltasoft.hr/rtc |
Piotr Szturmaj
![]() Delphi Developer |
2006-01-27 03:48:16 AM
Re:D2006 Hyperthreading Win32QuoteIf your code is thread-safe, it will run nicely on any PC (single cpu, |
Craig Stuntz [TeamB]
![]() Delphi Developer |
2006-01-27 04:36:03 AM
Re:D2006 Hyperthreading Win32
Danijel Tkalcec [RTC] writes:
QuoteThe problem with the old RTL MM (not the one in D2006 and newer) is -- Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz How to ask questions the smart way: www.catb.org/~esr/faqs/smart-questions.html |
Craig Stuntz [TeamB]
![]() Delphi Developer |
2006-01-27 05:14:48 AM
Re:D2006 Hyperthreading Win32
danny heijl writes:
QuoteI have to disagree. A busy Delphi 6 isapi websnap application will -- Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz Useful articles about InterBase development: blogs.teamb.com/craigstuntz/category/21.aspx |
Danijel Tkalcec [RTC]
![]() Delphi Developer |
2006-01-27 05:14:49 AM
Re:D2006 Hyperthreading Win32
The problem with the old RTL MM (not the one in D2006 and newer) is high
memory fragmentation, which this isn't only the case in multithreaded apps, it can also happen in single-threaded applications with high memory needs. Since Borland was clever enough to make it possible to for third-party vendors to write replacement memory managers, while there are a number of such memory managers available for free, I don't see a problem. Even before I started using FastMM (sourceforge.net/projects/fastmm), I haven't had a single case of memory corruption using the RTL MM. The only problems with the RTL MM were lower performance and high memory fragmentation (with performance getting worse as fragmentation increases). Since high fragmentation can eventually cause an application to run out of memory, even though there would be enough smaller free blocks available, the old RTL MM isn't the best choice for writing high-memory-load applications like Servers. But, even the old RTC MM will be sufficient for most desktop or client applications. -- Danijel Tkalcec - Team RTC www.deltasoft.hr/rtc |