Jump to content

David Heffernan

Members
  • Content Count

    3586
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by David Heffernan

  1. David Heffernan

    Experience/opinions on FastMM5

    I would expect so, but I don't know for sure. I do know that when using HeapCreate / HeapAlloc this is true, but that's no use to you. I do have a NUMA machine to hand and would be happy to run some tests on it if that would be useful for you.
  2. David Heffernan

    Experience/opinions on FastMM5

    My question was based on my own experience running multithreaded floating point software on NUMA machines, an issue that was live for me maybe three years ago. My problem was that most memory managers allocate out of a shared pool, but that cross node memory access is much more expensive than within node memory access. I didn't find any Delphi memory managers that were both robust and able to allocate memory local to the node on which the calling thread was executing. IIRC, allocators such as that of TBB and others used in the C++ world were able to do this. My application is a little different to more mainstream Delphi applications however. I understand that fastmm targets usage with frequent allocation of relatively small objects. In my application I preallocate wherever possible and avoid allocation in any hotspot. So my goal could just be boiled down to achieving affinity to the local node. In the end I wrote my own memory allocator on top of HeapCreate / HeapAlloc etc. The strategy is the each NUMA node has its own private heap (allocated by a call to HeapCreate). Each allocation is performed on the heap associated with the calling thread's node. I'm not in any way suggesting that such a simple strategy would be appropriate for fastmm. The interesting thing that I observed is that raw heap allocation / deallocation performance was never a problem for my app, because of the efforts we took to avoid allocation in hotspots. Likewise for thread contention, for the same reasons. The issue was that memory access speeds in my app is a key performance factor. And cross node access has dire performance.
  3. David Heffernan

    Experience/opinions on FastMM5

    Fine if you are multiprocessing, but not if multithreading.
  4. David Heffernan

    Thread programming without sleep or WaitFor events

    Unlucky for you. We've stopped supporting Windows 7, after all MS doesn't anymore.
  5. David Heffernan

    Delphi Closedown Error

    BPL not corrupted. Just a defect in some code that runs inside the IDE.
  6. David Heffernan

    Experience/opinions on FastMM5

    Would be interested to know whether NUMA memory is handled well.
  7. David Heffernan

    Thread programming without sleep or WaitFor events

    Regarding timers and energy use: https://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/
  8. David Heffernan

    Thread programming without sleep or WaitFor events

    You asked the same question on SO: https://stackoverflow.com/questions/61505887/thread-programming-without-sleep-or-waitfor-events It was closed there because it lacked focus. You seem to be wanting advice to a level of detail that far outstrips the level of detail used to specify your problem, and your current solution. In my view you are unlikely to be anything much out of a question asked the way you did. I recommend that you step back and provide a lot more detail and background. That will give you more hope of getting relevant advice.
  9. David Heffernan

    Capturing Console Output

    https://stackoverflow.com/q/19054789/505088
  10. David Heffernan

    Prevent WM_VSCROLL on TScrollBox to be executed twice in a row

    It's quite possible to solve your problem, but what you are proposing is not the solution. Solve your problem by responding to the underlying messages. If you have issues with flicker, they can doubtless be solved.
  11. David Heffernan

    Prevent WM_VSCROLL on TScrollBox to be executed twice in a row

    This looks badly wrong to me. What problem are you trying to fix?
  12. David Heffernan

    Prevent WM_VSCROLL on TScrollBox to be executed twice in a row

    Do you observe incorrect behaviour of your program?
  13. David Heffernan

    Making method with default encoding

    This provides no clarification to me. Now I think I have no idea what you are asking.
  14. David Heffernan

    Making method with default encoding

    You can't declare an encoding instance to be a default parameter value because it is not a constant, never mind a true constant. Hence the compiler error. So you have to resort to overloaded methods. Declare one method that accepts an encoding parameter. And another that does not. From that second overload call the first passing your chosen default encoding.
  15. David Heffernan

    Making method with default encoding

    Default values need to be true constants. This is not. You are confusing default encoding with default parameter value.
  16. David Heffernan

    Issue with variant in record in array

    Not needed. Really not a great idea to suggest needless actions with no basis in fact. Just spreads FUD.
  17. David Heffernan

    Issue with variant in record in array

    When the debugger evaluates some variables to display values in the debugger it often leaks memory. This is a defect with the debugger. The code here does not leak. Any reported leaks are due the debugger. I see this very often with property getter functions that return strings. The debugger calls the function, creating a new string. But then the debugger fails to destroy the string. Leak.
  18. David Heffernan

    Need to convert varbinary to hex string in a dll

    Why did you choose hex? Isn't base64 a better choice?
  19. David Heffernan

    Need to convert varbinary to hex string in a dll

    Seems odd. Why don't you return binary?
  20. David Heffernan

    License key system

    It is not interesting. Also, no guarantee that invalid pointer leads to access violation. Corrupted data is perfectly possible.
  21. David Heffernan

    License key system

    There's a huge difference between making an unintended mistake after having done your best not to, and intentionally harming. It's surely not difficult to see.
  22. David Heffernan

    License key system

    Tell that to the lawyers. Of course it matters.
  23. David Heffernan

    License key system

    Seconded.
  24. David Heffernan

    License key system

    FlexNet
  25. David Heffernan

    Profiler for Delphi

    VTune works well. AQTime was an unmitigated AV fest when I last tried it.
×