Jump to content

Jud

Members
  • Content Count

    141
  • Joined

  • Last visited

Community Reputation

1 Neutral

Technical Information

  • Delphi-Version
    Delphi 12 Athens

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Jud

    Multiple similar components

    Thanks, it works well. You guys are the greatest!
  2. I have 20 TMemos, named memo1 ... memo20. I have an integer which indicates which memo is to be written to. Is there a direct way to write to the desired memo, as opposed to a large, ugly case statement?
  3. Jud

    Problems with WaitForAll

    Thanks. I don't think that it must be called in the main thread.
  4. Jud

    Problems with WaitForAll

    So do I need to put all of the stuff where the tasks are called and WaitForAll into a thread, or just WaitForAll? I've tried the memo updates with and without TThread.Synchronize.
  5. Jud

    Problems with WaitForAll

    I have a multitasking program that has been running for weeks, but now I'm having problems adding WaitForAll to do some things when all tasks have been finished. First, some minor problems when I add WaitForAll: the main form is no longer responsive - I can't drag it or close it. Mainly though, are problems with updating the screen. Each task has a memo that it updates occasionally. Also, there are labels for the elapsed time and estimated remaining time. These work without WaitForAll but when WaitForAll is added, the program locks up if it tries to write to a memo or change the caption of a label. I know that these aren't thread safe, but they work if WaitForAll isn't in the program. Is there an easy way to get these to work?
  6. Update I've spent a good deal of time experimenting with this. There are two points: 1. The people that said to look at performance instead of CPU utilization were right. 2. Modern CPUs are different from older ones. I've done optimizations for multitasking for more than 10 years. Years ago I did it with Sandy Bridge, Ivy Bridge, and Haswell i7s (32GB of DDR3) and Sandy Bridge and Ivy Bridge Xeons (128GB of DDR3) - all with four hyperthreaded cores. On those, generally the higher the CPU utilization, the more throughput. The exception is when memory bandwidth starts to be the limit - then it is usually better to be running seven tasks instead of eight (in my tests). But now I'm doing it on 12th- and 14th-generation i7s (64GB and 128HB of DDR5) and Kaby Lake Xeons (512GB of DDR4). The Kaby Lake Xeon has four hyperthreaded cores and it behaves like the aformentioned CPUs. The new i7s with eight hyperthreaded cores behave differently. When running 16 threads, the CPU was utilized under 50%. I tried running more threads - that utilized more of the CPU, percentage wise, but didn't help performance. I tried 20 threads, and that had the same performance as 16 threads. I tried 24 threads, and that had 3% more performance than 16. I tried 28 threads and that had 3% less performance than 16 threads. These all utilized a higher percentage of the CPU. So you really aren't gaining much, if anything, by running more than 16 threads, in my test, and you are using more electricity. In fact, 15 threads performs better than 16.
  7. Well, I used to be able to get to 100% usage, now I can't get 50%.
  8. I was allowing it to use all cores. But it doesn't seem to be putting my program on E-cores To be sure, I set the affinity to use only P-cores. Neither way gives the performance I expected.
  9. I write some programs in Delphi that make heavy use of the CPU for a long time. I used to use Windows 7, 8, and 10 on Sandy Bridge, Ivy Bridge, and Haswell i7 CPUs, with four hyperthreaded cores. For multitasking, I could get 98% CPU usage. Now I'm using Windows 11 on 12th-14th generation i7s, with eight hyperthreaded P-cores. But I cannot get more than about 40% CPU usage with 16 threads running. I look at Task Manager and Process Monitor, and see the under-utilization of the CPU. I have the power setting set for high performance. What caused this loss in performance - Windows or the new CPUs? And is there a way to utilize most of the CPU?
  10. Well, I need to download it again and try the installation again.
×