Jump to content

Primož Gabrijelčič

Members
  • Content Count

    231
  • Joined

  • Last visited

  • Days Won

    9

Primož Gabrijelčič last won the day on June 3 2020

Primož Gabrijelčič had the most liked content!

Community Reputation

199 Excellent

5 Followers

Technical Information

  • Delphi-Version
    Delphi 10.2 Tokyo

Recent Profile Visitors

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

  1. Primož Gabrijelčič

    Is TOmniValue thread safe?

    On general, no. In specific cases maybe yes.
  2. Primož Gabrijelčič

    Support for Delphi 7?

    Nope, the earliest supported version is 2007.
  3. Primož Gabrijelčič

    Installing on Delphi 2007

    Indeed, I managed to screw that up 😞 Please take a fresh DSiWin32 from https://github.com/gabr42/OmniThreadLibrary/blob/master/src/DSiWin32.pas (just updated). It should fix the problem with D2007.
  4. Primož Gabrijelčič

    How to ADD CodeLibrarian snippets database?

    No, I never did any work on CodeLibrarian (as far as I can remember).
  5. Primož Gabrijelčič

    Planning for V4 (FMX support)

    V3 works with VCL/command line/service. V4 *will* also support FMX (current development v4 version does not).
  6. Primož Gabrijelčič

    Planning for V4 (FMX support)

    I'm only using Delphi tools for threading and synchronization so the end result should work on all supported platforms. I only tested on Ubuntu running on WSL2 though.
  7. Primož Gabrijelčič

    Planning for V4 (FMX support)

    There is work being done (sporadically) in https://github.com/gabr42/OmniThreadLibrary/tree/v4-develop-2 Current status is: low-level tasks work on Linux, except when they don't and everything locks up hard. (And I have no idea yet why that happens.)
  8. Primož Gabrijelčič

    DSIWin32 ComObj

    That's an implementation bug in DSiWin32. I'll fix that, thanks for the report. DSiWin32 should work correctly in Win64. If not, that's a bug. (Yeah, indeed, naming ...)
  9. Primož Gabrijelčič

    Messageloop in Omnithread task

    By default, an OTL task does not process windows messages (which is requirement for TTimer to work). To enfore windows message processing, call the MsgWait method of your task controller interface before running/scheduling the task. Like this: task := CreateTask(TWorker.Create()).MsgWait.Run; Read more here: http://www.omnithreadlibrary.com/book/chap07.html#lowlevel-tomniworker-msgwait
  10. Primož Gabrijelčič

    Messageloop in Omnithread task

    Variant 1: Use a 'procedure' worker (`procedure Worker(const task: IOmniTask)'). Then you can implement your message loop inside. Variant 2: Use a `TOmniWorker` descendant (as in my example). It will implement its own message loop. Variant 2a: Override parts of the TOmniWorker message loop (but I actually don't remember anymore how that is done 😠 ). You can handle most stuff with Variant 2. In addition to timers you can call Task.RegisterWaitObject to connect code to any waitable handle. See demo 31_WaitableObjects for more information. Read more here: http://www.omnithreadlibrary.com/book/chap07.html#lowlevel-iomnitask-registerwaitobject.
  11. Primož Gabrijelčič

    Messageloop in Omnithread task

    For a timer, call Task.SetTimer and timer event will be called automatically. Something like this: uses OtlTaskControl; type TWorker = class(TOmniWorker) protected function Initialize: boolean; override; public procedure TimerCallback; end; function TWorker.Initialize: boolean; begin Result := inherited Initialize; if Result then Task.SetTimer(1, 100, TimerCallback); end; procedure TWorker.TimerCallback; begin // called every 100 ms end; var task: IOmniTaskControl; task := CreateTask(TWorker.Create()).Run;
  12. Primož Gabrijelčič

    [Q] OmniThreadLibry AV at Task.Invoke

    Please provide a minimal program that demonstrates the problem.
  13. Primož Gabrijelčič

    10.4.1 Released today

    Long, long time ago 🙂 A quick google search found out that it was introduced in Delphi 4: http://www.blong.com/Conferences/DCon99/VCLSourcery/VCLSourcery.htm. Kudos to @blong who keeps 20 year old posts alive on the web!
  14. Primož Gabrijelčič

    10.4.1 Released today

    And on other systems it's just a wrapper around pthread_rwlock.
  15. Primož Gabrijelčič

    Omnithread DELPHI, many calls in the same function

    This is actually a COM problem, I believe, and I know almost nothing about COM, so please consider that my thinking may be entirely wrong. I believe that you are having problems because you initialize your server in tmApartment mode but then access it from multiple threads. http://docwiki.embarcadero.com/RADStudio/Sydney/en/Choosing_a_Threading_Model says for tmApartment: " All client calls use the thread in which the object was created." And the object is created in the main thread. Does your code work if you use TThread instead of OTL to run async tasks?
×