The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

    • RT @mmeeuw: Thierry Baudet over de ‚Äúlange arm van Erdogan‚ÄĚ 2016 en Thierry Baudet over de lange arm van Poetin in 2022 https://t.co/R8jS8oH‚Ķ 1 hour ago
    • RT @VogelvrijeHArts: Van alle pati√ęnten die de Praktijkondersteuner GGZ (POH-GGZ) in de huisartspraktijk ziet, heeft slechts 30% een psychi‚Ķ 1 hour ago
    • RT @IntoTheShitter: West Texas storm chaser Laura Rowe captured the picture of a lifetime, fantastic shot of a mature supercell thunderstor‚Ķ 1 hour ago
    • @helpdeskert Afwisselend pielen op mijn telefoon en proberen te slapen. Lukt soms. 1 hour ago
    • RT @locuta: Itali√ę zelf moet die troep gewoon niet denk RT @NBCNews: Domino's closes its last branch in Italy, citing increased competiti‚Ķ 4 hours ago
  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,856 other followers

Archive for July 23rd, 2019

Laptop fan profiling, and debugging them – related to Profiling | CommitStrip

Posted by jpluimers on 2019/07/23

A while back, I posted the “profiling” CommitStrip on[WayBack] Profiling – Jeroen Wiert Pluimers – Google+. Boy how did I not know that within a week, I bumped into a “laptop fan profiling” artefact.

A coworker noticed, that when starting a thread based equivalent of [WayBack] TTimer Class (which cannot be used in services as it depends on the VCL), then sometimes the laptop fans would spin up.

What basically happened was that for certain combinations of Enabled and Interval the Execute would loop burning 100% of one CPU core.

With 3 or more – sometimes 2 – of these threads active on a 4+4 core (4 are hyper-threaded), the processor fan would start to spin like madness.

Finding the solution was somewhat easy too:

  • Process Explorer would show the thread IDs burning the most CPU cycles
  • Delphi shows the Thread IDs in the Thread Status pane (if they are named, the ID is at the end of the name in parenthesis)
  • At around Delphi 2010, you can Freeze or Thaw threads. This allows you to debug only a single thread by freezing all others.

Focussing on one thread, allowed a close inspection of the loop, quickly finding the actual cause and repairing it.

TTimer Thread

A similar and better class is at [WayBack] multithreading РTTimerThread РThreaded timer class РCode Review Stack Exchange, based on [WayBack] timer РUsing VCL TTimer in Delphi console application РStack Overflow.

Read the rest of this entry »

Posted in Conference Topics, Conferences, Debugging, Delphi, Development, Event, Fun, Multi-Threading / Concurrency, Profiling-Performance-Measurement, Software Development | Leave a Comment »

Namespaces in Delphi – Stack Overflow

Posted by jpluimers on 2019/07/23

Blast from the past, but still relevant: [WayBack] Namespaces in Delphi РStack Overflow:

Q

Are there any practical benefits in using long unit file names like MyLib.MyUtils.pas or it is just a kind of unit name prefix?

A

Namespaces, like all identifiers, are meant to organize.

So using them, only benefits if your project gets organized in a better way. This is highly subjective matter (there have been ‘wars’ on even the most simple naming conventions!), so impossible to really answer.

[WayBack] Here is some documentation on how namespaces work in Delphi.

Note that ‘true’ namespaces (where more than one generic DLL can contribute to the same namespace; this is how namespaces function in the .NET world) are not possible in Delphi: you could go the BPL way, but that is not the same as a ‘generic DLL’. This is not a limitation of Delphi itself, but the way that native DLLs in Windows ‘work’.

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

DTW-DanWard/PowerShell-Beautifier: A whitespace reformatter and code cleaner for Windows PowerShell and PowerShell Core

Posted by jpluimers on 2019/07/23

Interesting tool: DTW-DanWard/PowerShell-Beautifier: A whitespace reformatter and code cleaner for Windows PowerShell and PowerShell Core

–jeroen

via: [WayBack] Is there a PowerShell code formatter / pretty printer? РStack Overflow

Posted in CommandLine, Development, PowerShell, PowerShell, Scripting, Software Development | Leave a Comment »

 
%d bloggers like this: