Jump to content

Search the Community

Showing results for tags 'omnithread'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 7 results

  1. How to set the affinity for TOmniThread/TOmiTaskControl, it is keep on resetting the default affinity value (utilizing all CPU's). I tried setting Environment.Process.Affinity.AsString, but this value also keep on changing to default (255), it is happening when the OmiThread starts, I see it have many properties to set the affinity, but I'm not sure how to set it.
  2. Hrushikesh Shet

    OTL Upgrade From 3.05 to 3.07.8

    We are working on a legacy application that is built using Delphi XE6. We have used the Omni Thread library and have version 3.05: 2015-09-07 installed. We are planning to upgrade OTL from the above-mentioned version to the latest release version 3.07.8 (https://github.com/gabr42/OmniThreadLibrary/archive/release-3.07.8.zip). Are there any known issues or any new issues? Is it safe to upgrade? Thank You.
  3. We are working on a legacy application that is built using Delphi XE6. We have used the Omni Thread library and have version 3.05: 2015-09-07 installed. We are facing an issue while executing this OTL code. When the control reaches line aTaskControl.WaitFor(10000); it doesn't execute any task. It skips and terminates the thread. This is happening randomly and more specifically in our Production environment whereas in the Dev environment it works fine. In our task, we are connecting to our database and performing some checks and updating the records based on some business logic. Any inputs or suggestions will be really helpful and appreciated. Thanks.
  4. Delphi10.2.3: OTL, FMX, ACTIVEX DCOM i have a big problem in my code to call the parallel.Async many times i have 6 ActiveX DCOM in Delphi, and wanna call these in same time, to calculate an invoice, so in my exe i work with OTL to async all calls activex, i don't like to wait result or freeze my screen. Parallel.Async( procedure (const task: IOmniTask) var iInnerExc: integer; begin /// ***********************************************************/// { return Log} TLogSingleton.Instance().Log('Services XX calcul: Début appel.',True); //************************* PARALLEL ASYNC ****************************// // executed in background thread try // {Create instance de ViewModel annexes: XXServiceXX} mainViewModelPreCalculOTLLevel03 := CreateMainViewModelOTLLevel03Class; {Affecter le même Model principal} mainViewModelPreCalculOTLLevel03.Model := fModel; {Suscribe the observer in list} mainViewModelPreCalculOTLLevel03.Provider.Subscribe(fSubscriber); {Call VieModel.ServiceXX} mainViewModelPreCalculOTLLevel03.StartPrecalcul; except on e:exception do {call the raise, juste ci dessous, dans le onterminated Handle} raise Exception.Create('Exception lors du traitement de Service XX.'); end; end, Parallel.TaskConfig.OnTerminated( procedure (const task: IOmniTaskControl) var excp: Exception; begin // executed in main thread if assigned(task.FatalException) then begin {expoiler l'exception, captcher ci dessus} excp := task.DetachException; TErrorSingleton.Instance().Log(Format('Service XX: [Fin TASK Error]. %s:%s',[excp.ClassName, excp.Message]),True); FreeAndNil(excp); end else begin // executed in main thread { return Log} TLogSingleton.Instance().Log('Services calcul: [Fin TASK] Fin appel traitement.',True); SendNotification([actServiceXXFinish]); end; end )); the Active X Call in exe FMX: (the server activeX is integreted in framework, i don't have the source code, and i don't know haw it writen) _Dm_Dcom := CreateObject('SERVICE.XX.CLT.SERVICEXX', 'DEFAUT') as ICoServiceXX; //Instance of the DLL //CALL the function in ServiceXX_impl _Dm_Dcom.GETTRaitementServiceXX(SafeArrayIn,SafeArrayOut,FListnerForPushNotif ); //with SafeArrayIn =Json IN, and take result in SafeArrayOut; FListnerForPushNotif to send notification (Type Interface: Iunknow) the ActiveX initialization in every SERVICEXX (DLL) TAutoObjectFactory.Create(ComServer, TTest, Class_Test, ciMultiInstance, tmApartment); in this DLL; we have ServiceXX_impl unit, we have one function to call traitement in another class, we can found a communication with the IInterface (published) to send notif like this: (FListnerForPushNotif as IDataListnerForPushNotification).PushNotificationForLog('Message to send to client side'); //we have many logs types: event, Error, Exception //PushNotificationForLog, PushNotificationForError,PushNotificationForException this is my call, i repeat it 6 times, Parallel.Async( CALL01 ); Parallel.Async( CALL01 ); Parallel.Async( CALL02 ); Parallel.Async( CALL06 ); i don't need to freeze my exe, and i don't need to wait, with SendNotification([actServiceXXFinish]); or other Action like "actService01Finish", "actService02Finish" i can kown if my traitement is finished or not, finaly, if i write all 6 calls, i will fall in many and many problems, like freeze screen, and deadlock (the only solution kill the process crl+alt+supp), but if i write only one call, it will be perfect, i have, my result, but the freeze screen persist, Conclusion: 1- with many calls: problems: screen freeze, traitement not working, --> kill the process. 2- with one only call: problems: screen freeze: the "TAniIndicator" not working and the screen freeze when Delphi enter in the other DLL (activeX). Nota: the Exe is FMX (in another step it will be a Form application), the 6 services are DLL (ActiveX DCOM). plz help me
  5. In OTL (3.0.7), OTLCommon.TOmniAffinity.GetMask calls DSiGetSystemAffinityMask, DSiGetProcessAffinityMask and DSiGetThreadAffinityMask which all call Winapi.windows.GetProcessAffinityMask, which can fail (I don't know under what conditions, but clients are reporting that it happens under Wine and also on at least one windows 10 system). If it fails, the var returns lpProcessAffinityMask and lpSystemAffinityMask are undefined. OTL release 1.40 made some changes to support 64 bit, and so I think in most places this behaviour won't show. However, for example OTLCommon.TOmniAffinity.GetCount has affMask := Mask; where affMask is a DWORD and mask is the NativeUInt property. An ERangeError won't be thrown unless: 64 bit arch range checking on GetProcessAffinityMask throws the second 64-bit param (lpProcessAffinityMask) value comes back as an invalid 32 bit value (I assume, under whatever conditions that trigger this issue, winapi doesn't change the stack val, so for example whatever was in that position happened to be an invalid 32 bit value) So my suggestion is that anywhere getProcessAffinityMask is called (I think just 3 places), it is checked for failure and if so some reasonable value is returned, eg if not GetProcessAffinityMask(GetCurrentProcess, Result, systemAffinityMask) then result := 1;
  6. Hello, I have an issue with the TOmniContainerWindowsMessageObserver and observers in general. I use one instance of TOmniMessageQueue to send data from a background thread to the main thread. However, it happens that several window are interested in receiving messages from the queue. So, I setup things like this: each form will create a TOmniContainerWindowsMessageObserver observer and attach it to the TOmniMessageQueue like this during the form's show event: MQObserver := CreateContainerWindowsMessageObserver(handle, WM_NEW_ITEM, 0, 0); // Create an observer that will notify the main form when new messages are received UserMessageQueue.ContainerSubject.Attach(MQObserver, coiNotifyOnAllInserts); // attach the observer to the message queue Likewise, when the form closes, the observer is detached and destroyed: UserMessageQueue.ContainerSubject.Detach(MQObserver, coiNotifyOnAllInserts); // we don't need the observer anymore FreeAndNil(MQObserver); My problem is that as soon as one observer is detached from the queue, all other observer stops notifying the other windows of the fact that a new message has been inserted. What am I missing here?
  7. Mr. E

    How to start?

    OK, I was trying to ask how to rewrite a Application that I create using thread to be more responsive, then I found this video: OmniThread Library - Primoz Gabrijelcic Thursday, September 3, 2015 What I need starts at Async/Await demo (t=300) So I'll leave the link, I will see it, read and practice to see if I can re write my application. Regards
×