-
Content Count
247 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Primož Gabrijelčič
-
Your pipeline is a local variable in `TForm1.PipelineExecute`. When this method exits, `ppl` goes out of scope and is destroyed. Put the pipeline in a form field.
-
Revisiting TThreadedQueue and TMonitor
Primož Gabrijelčič replied to pyscripter's topic in RTL and Delphi Object Pascal
Did some testing on that recently and most of the time wait functions work as expected while on some virtual machines they return early. The test cases were running on few Windows boxes and on two VMWare Fusion/Mac VMs. Worked OK on all but one. One Fusion/Mac combo consistently returned early from wait. -
OmniThreadLibrary 3.07.8 has just been released. It contains few small fixes + support for Delphi 10.4 Sydney. Changelog: New features: Implemented IOmniTask.RegisterWaitObject with an anonymous method callback. [Jacek Laskowski] donated a new OTL icon (res\OTL.ico). Added Delphi 10.4 Syndey packages. Bug fixes: [sglienke] A reference to an anonymous method executor in IOmniTask is cleaned up as soon as possible. This allows OTL tasks to be executed from a package. [issue #132] TOmniMREW.TryEnterReadLock and .TryEnterWriteLock were returning True on timeout. SetOnMessage(nil) works correctly. Fixed invalid FreeAndNil of an interface in TOmniFuture<T>.Execute. Compiles with Delphi 10.4 Sydney. https://github.com/gabr42/OmniThreadLibrary/releases/tag/release-3.07.8
-
Thank you, @Dalija Prasnikar, I just wanted to post exactly that 🙂 New release should go out this weekend.
-
[Q] OmniThreadLibrary - TaskGroup
Primož Gabrijelčič replied to DPStano's topic in RTL and Delphi Object Pascal
Indeed, OnTerminated is the correct approach. -
[Q] OmniThreadLibrary - TaskGroup
Primož Gabrijelčič replied to DPStano's topic in RTL and Delphi Object Pascal
Does this not already work out of the box? If a task is finished, WaitForAll should now that. -
Experience/opinions on FastMM5
Primož Gabrijelčič replied to Leif Uneus's topic in RTL and Delphi Object Pascal
Call stack depth is configurable in FastMM4. {------------- FullDebugMode/LogLockContention constants---------------} const {The stack trace depth. (Must be an *uneven* number to ensure that the Align16Bytes option works in FullDebugMode.)} StackTraceDepth = 19; -
Check the stack trace to see where this critical section is allocated from. If this is not possible with the FastMM that comes with Delphi (frankly, I don't use it and I have no idea), use FastMM from git and define FullDebugMode conditional.
-
Identify task by name in hreadpool
Primož Gabrijelčič replied to gorepj's topic in OmniThreadLibrary
This is not possible at the moment. You have to implement your own registration mechanism - register a task in some structure when you create it, deregister it when it is completed. -
pipeline and visual feedback
Primož Gabrijelčič replied to Attila Kovacs's topic in OmniThreadLibrary
Oh, that was you! Big thanks! For the record - I'm trying to keep the book in sync with the OTL most of the time. -
pipeline and visual feedback
Primož Gabrijelčič replied to Attila Kovacs's topic in OmniThreadLibrary
Without having a reproducible example, I have no idea. Yes, you need a new pipeline. After a pipeline goes into CompleteAdding state, it cannot be "revived". -
Beginner-Question: Server Prog, BackgroundWorker, unknown thread
Primož Gabrijelčič replied to t2000's topic in OmniThreadLibrary
Done. OmniThreadLibrary now uses only the DSiWin32 part and ignores DSiWin32.VCL. -
Beginner-Question: Server Prog, BackgroundWorker, unknown thread
Primož Gabrijelčič replied to t2000's topic in OmniThreadLibrary
Ah, I get it. I don't like to break compatibility but this is something that could be useful, indeed. Alternatively, I may move this functionality into DSiWin32.VCL (which may be altogether a better idea). -
Beginner-Question: Server Prog, BackgroundWorker, unknown thread
Primož Gabrijelčič replied to t2000's topic in OmniThreadLibrary
Defining NoVCL where? I don't understand. -
Beginner-Question: Server Prog, BackgroundWorker, unknown thread
Primož Gabrijelčič replied to t2000's topic in OmniThreadLibrary
I have fixed that (just now). DSiWin32 no longer uses Vcl.Graphics if symbol NoVCL is defined. -
pipeline and visual feedback
Primož Gabrijelčič replied to Attila Kovacs's topic in OmniThreadLibrary
Oh, a classic mistake 🙂 Been there, done that. -
Beginner-Question: Server Prog, BackgroundWorker, unknown thread
Primož Gabrijelčič replied to t2000's topic in OmniThreadLibrary
Sure, TOmniBlockingCollection is fine. -
pipeline and visual feedback
Primož Gabrijelčič replied to Attila Kovacs's topic in OmniThreadLibrary
I don't know. Show us the code. You are probably doing something after that "WaitFor" and I don't know what. What is confusing here? You don't have to wait for pipeline to terminate (WaitFor) to start processing its output. -
Beginner-Question: Server Prog, BackgroundWorker, unknown thread
Primož Gabrijelčič replied to t2000's topic in OmniThreadLibrary
I would love that too! -
Beginner-Question: Server Prog, BackgroundWorker, unknown thread
Primož Gabrijelčič replied to t2000's topic in OmniThreadLibrary
You can probably use PostThreadMessage Windows API to post a message directly to the main thread. Then you process this message in your process loop. -
pipeline and visual feedback
Primož Gabrijelčič replied to Attila Kovacs's topic in OmniThreadLibrary
Of course you can run a pipeline without a WaitFor. You have different options to detect when a pipeline has finished its work. a) The main program can count the number of items sent to the pipeline and number of items returned from. (If there is a simple correspondence between two - for example if each input produces exactly one output.) b) The pipeline itself can detect that it has no more work and then it can signal this to the main program. When you detect a terminating condition, you can shut down the pipeline (with WaitFor) and you'll done. See the "folder scanner" in OTL examples folder for an example of the b) technique or read this chapter of the book: http://www.omnithreadlibrary.com/book/chap10.html#howto-webDownload -
pipeline and visual feedback
Primož Gabrijelčič replied to Attila Kovacs's topic in OmniThreadLibrary
There is none. Only the main thread should update the UI in a VCL application so if it is blocked, you're out of options. In theory, you could create a window purely by the Windows API and use it to show the progress, but that is probably much to much work. Better solution would be to not block the VCL application at all. -
Access to Omnithread course material
Primož Gabrijelčič replied to David Champion's topic in OmniThreadLibrary
Presentations and code are available here. I'll send you a link to the video recording as a private message. -
BackgroundWorker stopping app closing
Primož Gabrijelčič replied to RussellW's topic in OmniThreadLibrary
When the WorkItem is freed. Usually that happens after it is dispatched to your notification handler (OnRequestDone, OnRequestDone_Asy). -
Delphi 10.3.2, IDE Fix Pack 6.4.4 When I close a project with File, Close All, I get this error: This happens with all projects. Startup Layout.dst attached. @jbg Startup Layout.dst