Questions tagged [omnithreadlibrary]

OmniThreadLibrary is a Delphi library meant to ease threading.

It's written mainly by Primož Gabrijelčič and released under BSD license.

Resources:

124 questions
2
votes
1 answer

How to use Pipeline pattern in Delphi

I am trying to implement a Pipeline pattern in my test project (How to make a Mutlithreded idhttp calls to do work on a StringList), but am having a struggle adapting TThread code to Pipeline pattern code. There are not many resources about how to…
Thunderx
  • 169
  • 1
  • 9
2
votes
1 answer

OmniThreadLibrary C++ builder Build issues

I'v been trying to get OmniThreadLibrary to run in builder, i've built it with all the c++ required files it builds ok but when i use it in an c++ builder app i get a bunch of error messages that look like the following [bcc32 Error]…
Shaun07776
  • 1,052
  • 1
  • 10
  • 16
2
votes
0 answers

Paint Polygons Multithreading delphi

For quite some time I tried to improve the speed of my painting program. Unfortunately I just achieved some small improvements by using the OmnithreadLibrary and also by parallelizing the painting process and the loading process of Objects. My Task…
2
votes
0 answers

Memory leaks in OmniThreadLibrary's Parallel.ForEach

I use OmniThreadLibrary. It has a parallel method ForEach. I'm working on high loaded system and I need to handle some array in parallel. But I get a memory leak. Here is a sample: procedure TForm7.FormCreate(Sender: TObject); var loop:…
2
votes
1 answer

How can i send messages from a Background Task to MainForm (OmniThreadLibrary)

How can i send messages (TOmniMessage) from Background Task to Main Form? I want send follow message to Mainform: Memo1.Lines.Add(Format('BEGIN: %s', [msg.MsgData.CastToStringDef('')])); main.pas (MainForm) unit main; interface uses …
Raimund
  • 21
  • 3
2
votes
1 answer

Limitation in the number of repeated calls for OTL's Parallel.ForEach

I got started using OTL for multithreading, and getting great helps! A variety of using Parallel.ForEach have been successful. But now I encountered an unaccountable case. Please see the simple and full code below: program test; {$APPTYPE…
TYK
  • 23
  • 5
2
votes
1 answer

Problems getting the JSON data from DLL using SuperObject and OmniThreadLibrary

I'm using Delphi XE, I have the following code for my program and DLL: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, superobject, OtlCommon, OtlCollections,…
LuFang
  • 191
  • 3
  • 12
2
votes
3 answers

How to parallel code a for-down-to loop in delphi, active over a list, deleting items as you go?

Take for example the following code: for i := (myStringList.Count - 1) DownTo 0 do begin dataList := SplitString(myStringList[i], #9); x := StrToFloat(dataList[0]); y := StrToFloat(dataList[1]); z := StrToFloat(dataList[2]); //Do something…
2
votes
1 answer

Pass TStringList to TOmniTask procedure

I am using the OmniThreadLibrary in a Delphi 2007 app that utilises the global thread pool to preform some file operations (I need to try and make sure they are done in a specific order). I have the contents of a newly created Ini file that is…
Gavin
  • 2,123
  • 1
  • 15
  • 19
2
votes
0 answers

Error when using strings in TOmniValue array in a BackgroundWorker

When I have a string in a TOmniValue array, then accessing the value by name or by explicit index raises an access violation. See the following code for an example. Am I doing something wrong, or is there an error in Delphi or TOmniValue? I found a…
boileau
  • 817
  • 6
  • 20
2
votes
1 answer

Correct installation of OmniThreadLibrary

I want to use OmniThreadLibrary in a project I am working on Delphi XE2, I've followed the instructions. Add OTL folder and OTL/src to Delphi's Library Path. Build both project in Delphi XE2 package and install. The instructions are pretty simple…
Diego Rueda
  • 2,226
  • 4
  • 21
  • 41
2
votes
1 answer

Is there a less CPU-intensive alternative for TOmniMREW?

I'm after a slim Single-Read Multi-Write lock, similar to TOmniMREW, but that would be less CPU-intensive in cases of contention. TOmniREW uses only a spinlock, so threads will skyrocket to 100% CPU usage until they can acquire the lock. Currently…
Eric Grange
  • 5,931
  • 1
  • 39
  • 61
2
votes
1 answer

Why is OmniThreadLibrary's ForEach blocking main thread?

Using the OmniThreadLibrary and Delphi XE4, I am hoping to run multiple threads that process data in the background, adding speed increases to my already existing code. When calling the procedure below, the Application GUI stops processing any input…
Dan
  • 303
  • 1
  • 13
2
votes
2 answers

How to determine cause of main thread not responding with Omni Thread Library?

Platform: Delphi with VirtualTreeView SVN 5.1.0 & OmniThreadLibrary 3 SVN & Delphi XE2 Originally I thought that the problem was VirtualTreeView. I need to add node to VST every 1s or less.But It seems soon or later the CPU rate will hit 50% or more…
XARA
  • 23
  • 3
2
votes
3 answers

OmniThreadLibrary: How to detect when all recursively scheduled (=pooled) threads have completed?

Let's say I have to recursively iterate over items stored in a tree structure in the background and I want to walk this tree using multiple threads from a thread pool (one thread per "folder" node). I have already managed to implement this using…
1 2 3
8 9