Jump to content

Fr0sT.Brutal

Members
  • Content Count

    2268
  • Joined

  • Last visited

  • Days Won

    46

Everything posted by Fr0sT.Brutal

  1. Fr0sT.Brutal

    GExperts and virus scanners

    Maybe using new Inno versions will help?
  2. Interesting option but the usage of BOM makes it almost useless
  3. Fr0sT.Brutal

    QP suggestion: GetIt cache

    Freezing UI in a software that costs ~$1k *facepalm*
  4. Fr0sT.Brutal

    Changing label text in thread leads to weird display

    Don't bother, you explained it pretty clear but 2 bytes could easily cross 32bit boundary couldn't they?
  5. Fr0sT.Brutal

    Changing label text in thread leads to weird display

    Yes, and I see that w2 field is not aligned. And it is 2 bytes long so, AFAIU, potentially prone to non-atomic change. Well, Pawel's experiment shows that in some cases they won't. Moreover, alignment lesser than 32 could be forced by project options. If you ship a library unit that gets recompiled along with 3rd party's project, you'll have to explicitly specify alignment to avoid access collisions.
  6. Fr0sT.Brutal

    Changing label text in thread leads to weird display

    Regarding the strings - assignment is performed in these steps: ( Initially we have string S1 that is pointer P1 pointing to memory M1 and assigning to it string S2 that is pointer P2 pointing to memory M2 ) 1) ref count of S2 is interlocked-incremented 2) P1 is saved to Ptmp 3) value of P1 is replaced with value of P2 4) ref count of string that Ptmp points to is interlocked-decremented 5) if new ref count is 0, M1 is deallocated All these steps are not performed as single atomic operation so could be interrupted by another thread. So, if another thread is reading, it could interfere in any place between and even inside these steps. For example: 0) Initially Thr1 has string field that Thr2 reads and holds the copy in its internal variable so the field has ref count 2 1) Thr1 assigns new value to its field, thus decrements ref-count, new ref-count is 1 2) Thr2 reads new value from Thr1's field thus decrements ref-count, new ref-count is 0 3) Thr1 checks if ref-count is 0 - true 4) Thr2 checks if ref-count is 0 - true 5) Thr1 deallocates memory 6) Thr2 deallocates memory - KABOOM!
  7. Fr0sT.Brutal

    Changing label text in thread leads to weird display

    It's a rare case for variables that are accessed from several threads to be independent. Usually they are fields of a structure/object/class so nothing could guarantee they're aligned without explicit measures. So you'll have to either ensure alignment (by using paddings, dummy fields, $A directives etc) or just accept that accessing variables of size more than 1 byte is probably not atomic. Thanks for clarification, I missed the influence of data bus.
  8. Fr0sT.Brutal

    Changing label text in thread leads to weird display

    Hm, what if a variable isn't aligned? It produces single mov instruction anyway. Or do you mean that CPU will have to do several instructions to modify that variable? If that is true, seems no simple variable or member could be safely accessed without locks, at least until a code aligns it at runtime explicitly
  9. Fr0sT.Brutal

    Sourcetrail support for Delphi

    Yes but now it's more like "Idera as Embarcadero" typecast
  10. Fr0sT.Brutal

    Sourcetrail support for Delphi

    Offtopic: I think we should create some short macro that would mean "whatever company that owns Delphi at the moment"
  11. Fr0sT.Brutal

    ICS Wish List

    Not so high actually at least to have it working at a simplest level.
  12. Fr0sT.Brutal

    how get results back from a low level task?

    PostMessage from bg thread to main form with LParam=your-generated-bitmap
  13. © JK Rowling, HP & Philosopher's stone. That's all what should be said about English measure system 😄
  14. Fr0sT.Brutal

    Cross-platform solution to forcefully end a thread

    I wonder what SQLite guys suggest to use instead of threads. Maybe they'll say "Use DB queries in the very main thread, and if you have queries lasting longer than 200 ms, do not use DB"? 😄
  15. Russian also has legacy naming of 11..19: 11 is odinnadzat = odin-na-desyat = one-and-ten while numbers above 20 are usual "most significant digit first" like 21 is dvadzat odin = twenty one. And all numers that are multiple of 10 are named in the same logical manner like 30 is tridzat = tri-desyat = three tens except 40 which is just weird "sorok". Well, even the strict and logical English has 11 and 12 with their own personal names, maybe it's a legacy of 12-al system?
  16. In some places I use such constructions for ctrl in TArray<TControl>.Create(Button1, Checkbox1, Memo1) do ctrl.Enabled := True;
  17. Fr0sT.Brutal

    Cross-platform solution to forcefully end a thread

    With all the respect to professor and so on, marking threads the absolute evil rather looks like being unable to use them right. There's no other means of doing several things at one time. All the async sugar is implemented via threads under-the-hood. Processes? Highly similar to threads. Some languages strive to hide this mechanism from a programmer, just like Go and JS. But they use threads internally anyway. I suspect pr. Lee doesn't suggest any acceptable alternative?
  18. Fr0sT.Brutal

    How to compare msXML nodes

    My idea was: - you have your XML loaded - you loop through nodes and number them with unique ID's - now you can easily identify the nodes returned by FindNode - when it's time to save XML, first clean these temporary ID's but now when you mention two processes, I got lost and can't realize what exactly you want. Maybe if you could describe your task in brief but fully it'll shed some light.
  19. Fr0sT.Brutal

    Main menu

    You can rename/remove refactoride###.bpl file
  20. Fr0sT.Brutal

    DUnitX and testing MemoryLeaks

    Vincent, I can understand multiple dproj, but there are multiple dpr-s!
  21. Fr0sT.Brutal

    Cross-platform solution to forcefully end a thread

    What if CallStuffThatMightBlockForever never returns?
  22. Fr0sT.Brutal

    DUnitX and testing MemoryLeaks

    @Vincent Parrett lol now when you mentioned a console project I noticed the bunch of DUnitXTest_*.dpr files :D. I've really overlooked them thinking it's just packages or similar. Is it really necessary having a specific project file for each compiler version?
  23. Fr0sT.Brutal

    How to manage defined list values

    Yup, my mistake. Codeinsight doesn't show arrays, even constant ones.
  24. Fr0sT.Brutal

    Extend Delphi 10.3 Code Editor

    You can start from examining available OTA interfaces for necessary events and methods. Anyway the code editor is just a Windows' window (heh) so it probably supports standard WM_*/EM_* messages
  25. Huh, ICU lib contains pretty much more than 100 files and that is even not considering data, only the code! Of course ICU is global but proper int-tion isn't piece a cake O___O Wow, so weird! Didn't know that.
×