Are Threads and Timers preemptive in FireMonkey under Delphi XE3?

I've searched the forum and tried to find this in the documentation - all to no avail. I'm starting a new project and I'm considering moving from XE2 to XE3 for it. In my app, I need to have several timers and threads running and THE key requirement is that they are not subject to blocking. The app will need to run under both Windows and OS X.

Any help is appreciated.

-Mike
0
Michael
9/27/2012 1:12:41 PM
embarcadero.delphi.firemonkey 4901 articles. 4 followers. Follow

6 Replies
2347 Views

Similar Articles

[PageSpeed] 12
Get it on Google Play
Get it on Apple App Store

> In my app, I need to have several timers and threads running
> and THE key requirement is that they are not subject to blocking.

You should expect similar behaviour to the VCL. Are you not getting that?

--
Chris Rolliston
http://delphifoundations.com/
0
Chris
9/28/2012 2:16:25 PM
> {quote:title=Chris Rolliston wrote:}{quote}
> > In my app, I need to have several timers and threads running
> > and THE key requirement is that they are not subject to blocking.
> 
> You should expect similar behaviour to the VCL. Are you not getting that?
> 
> --
> Chris Rolliston
> http://delphifoundations.com/

I have not invested the time to write a test app. I'm not sure that I would be able to test it correctly under both Windows and OSX to determine if there are events which cause thread blocking. After searching the documentation to no avail, I was hoping that a knowledgable source would be able to reply to my question.
0
Michael
9/28/2012 3:34:55 PM
> {quote:title=Michael Bierly wrote:}{quote}
> I've searched the forum and tried to find this in the documentation - all to no avail. I'm starting a new project and I'm considering moving from XE2 to XE3 for it. In my app, I need to have several timers and threads running and THE key requirement is that they are not subject to blocking. The app will need to run under both Windows and OS X.
> 
> Any help is appreciated.
> 
> -Mike

Threads and Timers in windows applications should behave the same as their VCL counterparts - as they are based on the same Windows APIs as the VCL.  Given that I have no access to OSX right now I couldn't comment on their behaviour.  I would recommend testing the behaviour, FM does hide the message queue from you quite effectively in both versions, but the Thread and Timer code hasn't changed AFAIK between XE2 and XE3.
0
paul
9/28/2012 3:56:02 PM
> I'm not sure that I would be able to test it correctly under both Windows and OSX to determine
> if there are events which cause thread blocking. After searching the documentation to no avail,
> I was hoping that a knowledgable source would be able to reply to my question.

On OS X, BeginThread and TThread use the *nix pthreads API and TTimer the Cocoa NSTimer class. Notwithstanding the fact Cocoa doesn't make an application's message loop as 'see through' as the Windows API does, the behaviour of the respective timer objects is pretty much identical. In particular, timer messages have a low priority, and if the application isn't able to handle one tick for a given timer before the next one is due, the first is just 'dropped'.

To be honest though, I'm not quite sure what you mean by 'thread blocking'. If a mere user interface-related event in the main thread caused a secondary thread to block, and this wasn't caused by the explicit use of synchronisation objects, that would be a serious OS bug, no...?

--
Chris Rolliston
http://delphifoundations.com/
0
Chris
9/28/2012 9:46:56 PM
> {quote:title=Chris Rolliston wrote:}{quote}
> > I'm not sure that I would be able to test it correctly under both Windows and OSX to determine
> > if there are events which cause thread blocking. After searching the documentation to no avail,
> > I was hoping that a knowledgable source would be able to reply to my question.
> 
> On OS X, BeginThread and TThread use the *nix pthreads API and TTimer the Cocoa NSTimer class. Notwithstanding the fact Cocoa doesn't make an application's message loop as 'see through' as the Windows API does, the behaviour of the respective timer objects is pretty much identical. In particular, timer messages have a low priority, and if the application isn't able to handle one tick for a given timer before the next one is due, the first is just 'dropped'.
> 
> To be honest though, I'm not quite sure what you mean by 'thread blocking'. If a mere user interface-related event in the main thread caused a secondary thread to block, and this wasn't caused by the explicit use of synchronisation objects, that would be a serious OS bug, no...?
> 
> --
> Chris Rolliston
> http://delphifoundations.com/

Thanks Chris, you have answered my question for OS X. 

My concern was how the timers and threads were being implemented under FireMonkey. I won't mention the other tool so that they don't get lambasted, but I'm aware of another dev tool for OS X that the timer and thread pools are an implementation of the dev tool itself. Due to that specific implemention, events such as opening a menu, dragging a window etc cause the timers and threads to "freeze" during that operation. It isn't an OS bug but just a problem with the way that company implemented their own han
dling for them. I wanted to make sure that FireMonkey didn't do something equally ridiculous under the covers.
0
Michael
9/28/2012 10:39:16 PM
> It isn't an OS bug but just a problem with the way that company implemented their
> own handling for them. I wanted to make sure that FireMonkey didn't do something
> equally ridiculous under the covers.

Ah, OK.

--
Chris Rolliston
http://delphifoundations.com/
0
Chris
9/28/2012 11:00:54 PM
Reply:

Similar Artilces:

Ann: FastReport FMX for Delphi XE3 (FireMonkey 2) and XE2 (FireMonkey) released
Dear friends, Visual report designer is available now on both MS Windows and MAC OS X! Full sources. We can write here full list of possibilities, but it will so long. Let see FastReport VCL and FastReport FMX comparison table: http://www.fast-report.com/en/products/comparison-fast-report-firemonkey-vcl.html And all of this - just now in your hands for business-applications for Mac. Report generator FastReport FMX is the first multiplatform solution for including Business Intelligence into software based on Embarcadero FireMonkey IDE (Delphi for MS Windows and Apple Mac OS X)...

Ann: X-platform report generator for Delphi XE3 (FireMonkey 2) and XE2 (FireMonkey) released
Dear friends, Visual report designer is available now on both MS Windows and MAC OS X! Full sources. We can write here full list of possibilities, but it will so long. Let see FastReport VCL and FastReport FMX comparison table: http://www.fast-report.com/en/products/comparison-fast-report-firemonkey-vcl.html And all of this - just now in your hands for business-applications for Mac. Report generator FastReport FMX is the first multiplatform solution for including Business Intelligence into software based on Embarcadero FireMonkey IDE (Delphi for MS Windows and Apple Mac OS X)...

MD5 SHA* Hash in Delphi Firemonkey 2 [Rad XE3]
Hi. I have searched the web for tow days now, and I could not find any components that can do md5 sha1 sha256 sha512 and are compartabe with firemonkey, win + osx. Mybe someone knows a good package or two. Thanks. ...

Delphi XE3 plus CBuilder XE3 demo is still Delphi only
Have Delphi XE3 installed (and registered), tried to install the CBuilder XE3 demo to see if it work as required. The result is that only Delphi was updated and no CBuilder available. Is there a way to test it - I would have upgraded to full RadStudio but doubted the CBuilder 64 bit compiler would be available in time (deadline is almost here and already ported the code to VC++ but don't particularly like it). ...

Touch Gestures in Firemonkey 3D application Delphi XE3 MacOS [Edit]
Hi! I'm trying to create a MacOS Firemonkey 3D application with gestures enabled but I can't make it work. I can place a GestureManager on the form but there is no Touch property on the TForm3D object. Then I've tried to create a TLayer3D with a normal TPanel where I was able to set the Touch property but the gestures didn't work although it captured any other mouse movements. Then I've created a separate HD TForm with a GestureManager and with the Touch property set which worked as a stand alone form but whe n I've linked a touch enabled TPanel on the HD TForm to t...

How to show custom cursor on transparent firemonkey form Delphi XE3 [Edit]
HI. In my application I need to show a semi-transparent form with specific cursor. A simple example: procedure TForm1.FormCreate(Sender: TObject); begin Fill.Kind := TBrushKind.bkSolid; Fill.Color := $50000000; Top := 0; Left := 0; Width := 600; Height := 600; Transparency := true; Cursor := crSQLWait; end; but cursor is changed only when I start mouse moving. I don't know how to fix it:( Edited by: Sam Rob on Apr 8, 2013 1:31 AM decision: I add to onActivate: Cursor := crSQLWait; Application.ProcessMessages; ...

Firemonkey delphi xe3 warning can't parse __DATA/__objc_imageinfo section
I would like to know how to resolve this warning problem and what does it mean thanks for all answer. [DCC Hint] H2596 ld: warning: can't parse __DATA/__objc_imageinfo section in C:\Users\reaz\Documents\RAD Studio\SDKs\iPhoneOS6.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation Am 2/6/13 4:30 PM, schrieb reaz ahmeer: > I would like to know how to resolve this warning problem and what does it mean > > thanks for all answer. > > [DCC Hint] H2596 ld: warning: can't parse __DATA/__objc_imageinfo section in C:\Users\reaz\Documents\RAD Studi...

Migrating from Delphi 7 to Delphi XE3
Hello, Its time to leave the old Delphi 7 and move to the new (but not the latest) XE3. I was wondering if there is a good book or reference to learn all new things XE3 added. Any suggestions? On 5/3/2013 10:17 PM, George Karatsiolis wrote: > Hello, Its time to leave the old Delphi 7 and move to the new (but not the latest) XE3. > I was wondering if there is a good book or reference to learn all new things XE3 added. Try this one for starters: http://tinyurl.com/cgsu243 Aside from that you really need to evaluate your application. XE3 is Unicode for example.... So her...

Delphi 2010 professional to Delphi XE3
Hello, Sorry for this is not right place to ask this question: I have Delphi 2010 professional version, I like to upgrade to Delphi XE3 Am eligible to upgrade or no not? I like answer from Delphi sales team. I couldn’t find email to ask them. Thanks Mike Thomas <> wrote in news:506459@forums.embarcadero.com: > Hello, > > Sorry for this is not right place to ask this question: > I have Delphi 2010 professional version, I like to upgrade to Delphi > XE3 Am eligible to upgrade or no not? I like answer from Delphi > sales team. I couldn’t find emai...

How to use a delphi XE3 obj file in delphi 2007?
Hi, I'm migrating an application from delphi 2007 to delphi XE3 and I would like to do it in several steps. To do this I need to use a part of my new code (XE3) in the current delphi 2007 application. So I want to use the .obj file from my XE3 file. I know I have to use the {$L 'Filename'} and I know that I have to declare the functions that I want to use in external in my D2007 project. I wanted to make an easy and simple example to see how it works with only 1 function 'hello world' compiled in obj with XE3 but I can't find the way to use it in D2007. In D200...

Making Firemonkey more compatible with Delphi
I have programmed in Delphi since 1995 Delphi1 I am now evaluating Delphi XE4. It boggles my mind, why embarcadero has lost the most important aspects of Delphi. Simplicity and Fast User Interface creation. I can easily see how Firemonkey can be improved to bring it in line with traditional Delphi Techniques by doing the following. 1. All Firemonkey controls need a data aware counterpart. 2. Firemonkey Styles need to be converted to TControl descendants. 3. ie. TLayout goes to TPanel ( TFMXPanel ) 4. ie. TRectangle does to TFrame TFMXFrame ) 5. LiveBindings gets placed un...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

Delphi XE2, OSX and FireMonkey?
1. Does anyone know if developing with FireMonkey will be the only way to develop for OSX with XE2? 2. Does anyone know if you will need to compile on a Mac for OSX, or will XE2 cross compile? I know this will all come out during the world tour, but I'm just trying to get some idea so I can start planning. 1. Yes, I think for now it will be the only way. But you can probably build a native UI for OSX by directly using the API, like you can also develop Win32 applications without using the VCL. 2. XE2 will only be available for Windows, but it will compile for other platforms. &l...

ArcGIS runtime errors after upgrading from Delphi 2007 to Delphi XE3
We have an application written in Delphi Pascal that accesses the ArcGIS 9.3 API through the COM interface. We recently upgraded from Delphi 2007 to Delphi XE3 and ever since we upgraded we have been getting runtime errors in the ArcGIS libraries that we were not getting before. Specifically the error is always "invalid floating point operation". The first one that was occurring was happening in the method "sg.SgCoordRefSetZ". I was able to eliminate this error by adding a call to FGeoSpatialReference.SetZDomain(-10000, 100000.0) even though there is nowhere that we&#...

Web resources about - Are Threads and Timers preemptive in FireMonkey under Delphi XE3? - embarcadero.delphi.firemonkey

Preemptive war - Wikipedia, the free encyclopedia
A preemptive war is a war that is commenced in an attempt to repel or defeat a perceived offensive or invasion , or to gain a strategic advantage ...

Press Conference - 5:30 Thurs - 3340 W Fillmore: National Lawyers Guild Condemns Preemptive Police Raids ...
... Chicago Press Relations hat eine Notiz mit dem Titel Press Conference - 5:30 Thurs - 3340 W Fillmore: National Lawyers Guild Condemns Preemptive ...


The Preemptive War On Paul
The global hegemonists in the GOP – who have never fully addressed the fiscal, moral and military fiascoes that were the Afghan and Iraq wars ...

Kim Dotcom loses new domain in preemptive strike by government
One week after Kim Dotcom unveiled "Me.ga," the domain for his new file sharing service to replace Megaupload, the government of Gabon in Africa ...

Randi Zuckerberg: Preemptive Haters of ‘Silicon Valley’ Should Chill
The joyful news that Bravo, that Octomom of reality TV-producing basic cable, will pop out another manufactured drama-filled baby in the form ...

Seattle's 5 Point bar gets reaction with preemptive ban of Google glasses
Seattle's 5 Point Cafe has received quite a bit of attention for its ban of Google Glass, the high-end specs that put your smartphone's capabilities ...

Stripping the political rhetoric out of Obama's preemptive attack on a Supreme Court that would strike ...
... Attorney General Eric Holder files the 3-page, single-spaced letter demanded by the 5th Circuit explaining the Administrations actual position ...

PREEMPTIVE SURRENDER IN THE PACIFIC: Obama Bows to China, Humiliates Japan
Guest post by Investor's Business Daily National Security: As the media praised the president for sending two B-52s through disputed air space ...

N. Korea Threatens Preemptive Nuclear Strike as UN Meets
North Korea threatened to launch a preemptive nuclear strike on its “aggressors,” including the U.S., ahead of a United Nations vote on tougher ...

Resources last updated: 12/1/2015 7:22:54 AM