Jump to content

Dalija Prasnikar

Members
  • Content Count

    1111
  • Joined

  • Last visited

  • Days Won

    96

Everything posted by Dalija Prasnikar

  1. Dalija Prasnikar

    FYI - Several Embarcadero services are currently unavailable

    I have multiple Delphi version installed and working on my machine, including Delphi 11 and 12. They all work fine. Installing new version didn't break my old versions. So the question is what you have done to have your Delphi 12 installation break Delphi 11 installation?
  2. Dalija Prasnikar

    Rtti multi-thread deadlock

    Only problem you can face is if you are using dynamically loaded packages as the RTTI for that package will point to invalid memory. But I am not sure how relevant is that to the macOS as I don't know if you can even use runtime packages there. Thanks! I added the test project.
  3. Dalija Prasnikar

    FYI - Several Embarcadero services are currently unavailable

    AFAIK, Idera runs the whole IT infrastructure for multiple companies under their umbrella.
  4. Dalija Prasnikar

    Rtti multi-thread deadlock

    Yes, it will call EnsurePoolToken, but if the global token already exists it will not lock PoolLock while it tries to create one.
  5. Dalija Prasnikar

    Rtti multi-thread deadlock

    Yes, this looks like a classic deadlocking bug. One thread locks one lock, while another locks other and they are dead in the water. It should be reported. Possible workaround would be acquiring context at the application initialization (with KeepContext) and releasing it on shutdown. That way you would prevent EnsurePoolToken called from KeepContext to lock PoolLock.
  6. Dalija Prasnikar

    FYI - Several Embarcadero services are currently unavailable

    https://blogs.embarcadero.com/we-are-experiencing-a-hardware-outage/
  7. Dalija Prasnikar

    FYI - Several Embarcadero services are currently unavailable

    This is why I said that this was not a software problem, but a hardware problem. Beyond that anything anyone says is pure speculation.
  8. Dalija Prasnikar

    VCL error with caFree

    It is directly dispatched in TCustomForm through procedure CMRelease(var Message: TMessage); message CM_RELEASE;
  9. Dalija Prasnikar

    VCL error with caFree

    CM_RELEASE is simple procedure TCustomForm.CMRelease; begin Free; end; Yes, you can intercept it in your form.
  10. Dalija Prasnikar

    FYI - Several Embarcadero services are currently unavailable

    Who said that it is server that failed? When workers cut my phone cable I was without access to Internet it for three days (that was long before broadband Internet was available). There is just some stuff where you cannot possibly have redundancy, or the cost would just be a way too much. It is not like they are running mission critical infrastructure, so they need to be prepared for absolutely every scenario. And even then, there are things that might happen outside of their (or anyone's) control. Not everything that ever happens is result of some incompetence. As far as Facebook is concerned you can read it here https://en.wikipedia.org/wiki/2021_Facebook_outage What this page does not cover is breaking into the server room, but that was something one of people involved posted on Twitter at the time. The problem was that entering the server room also required authentication which was not working because their whole network infrastructure was down. I have no idea what they have or have not learned from that incident.
  11. Dalija Prasnikar

    VCL error with caFree

    Error happens when CM_RELEASE is sent to a form. The fix is to avoid calling VisualManager in that scenario. Instead in WndProc, you can also add check in VisualManager_AcceptMessage method before the code within tries to access FVisualManagerInitialized field. procedure TCustomForm.WndProc(var Message: TMessage); ... inherited WndProc(Message); if (Message.Msg <> CM_RELEASE) and VisualManager_AcceptMessage(Message) then VisualManager_WndProc(Message); end;
  12. Dalija Prasnikar

    FYI - Several Embarcadero services are currently unavailable

    I am sure that everyone here has everything in duplicate, so when something dies they can replace it in an instance with minimal interruptions, especially if it dies over the weekend during the huge cold spell. Stuff happens, no matter how small or big the company is. Do I need to remind you that on one instance Facebook folks had to literally break into their server room because they got locked out of it. I am not going to defend the lack of official communication, this is something that needs to change, but this is also not something that people on lower hierarchy levels (meaning the ones that blog and communicate with us) can do on their own.
  13. Dalija Prasnikar

    FYI - Several Embarcadero services are currently unavailable

    FWIW, you can forget about software jokes, it is piece of hardware that died.
  14. Dalija Prasnikar

    Delphi 12: The Embarcadero Gelt server could not be reached...

    Yeah... it will be replaced by another official statement. But, I guess in the meantime, the title tells part of the story.
  15. Dalija Prasnikar

    Delphi 12: The Embarcadero Gelt server could not be reached...

    https://blogs.embarcadero.com/we-are-experiencing-a-hardware-outage/
  16. Which will happen during the cleanup in TThread destructor because of fEven.SetEvent which is called in TerminatedSet. Please read everything I posted before. If you don't trust me, then run the code yourself. We are running in circles now.
  17. The TThread destructor will call all that. I suggest you look at the source code. After that inherited destructor call is finished, the background thread will no longer run and it will be safe to call fEvent.Free.
  18. I said "was possible race condition", which is fixed if you call inherited thread destructor before you call fEvent.Free.
  19. Self destructing threads, while useful, have their own issues. They cannot be terminated directly, waited for, or properly cleaned up during the application shutdown and can cause various issues and exceptions during the shutdown. Basically, you lose proper application cleanup. Actually, you can do proper cleanup with such threads, too, but only if you add plenty of code that will also have to fiddle around with Windows API, and when doing all that, you are effectively rewriting infrastructure that is already in place inside TThread class. And then you are back to the square one, where you need to handle thread cleanup in proper order, basically achieving nothing comparing to using thread class that you need to manually Free - which again will work properly, if you pay little attention.
  20. Event will be triggered when TerminatedSet is called, which will be called as part of the thread cleanup process triggered by inherited destructor. There is no undefined behavior. Thread will finish, there was only a possible race condition where fEvent could have been released while background thread was still using it.
  21. Default TThread destructor will wait for thread to finish, so there will be no undefined behavior. That is why this inherited destructor needs to run first. Otherwise, you must always wait for a thread before you call Free on it. Because it is easy to forget calling WaitFor before calling Free every time you use a thread somewhere, it is much safer to call the inherited destructor first, because that is something you need to write only once.
  22. @Remy Lebeau fEvent should be released after inherited destructor runs as thread might still be running at that time if thread is not waited for before calling Free (which is not common pattern in Delphi code) destructor TTimerThread.Destroy; begin inherited Destroy; fEvent.Free; end;
  23. Depends on the decision. Replacing Sleep with event later on is trivial. In this case we don't even know whether we need to have a thread that will sleep or wait on an even in the first place. This is the "wrong direction" I am talking about.
  24. If you know absolutely nothing about threads, then Sleep can be a first step towards solution. It will at least give you a simple proof of concept code. If you need to learn everything at once it can be overwhelming. But, again, at this point we are discussing the Sleep vs events while we don't even know if we are going in the right direction.
  25. I don't think we are at that level yet. We first even have to establish what is even remotely appropriate solution, given that the problem is vague. And then we can start optimizing the code. So Sleep() suggestion is a valid one. If Sleep could be used, then we can offer better solutions than using Sleep().
×