[fpc-devel] Threads and alot of crap continued

Micha Nelissen micha at neli.hopto.org
Wed Nov 8 11:53:21 CET 2006

Michael Schnell wrote:
> the need for a GUI, I'd like to enhance the concept by optionally having 
> an TApplication object for any thread (e.g. TThread.Application) and 

It shouldn't be named Application, because there is only one application 
per process.

> thus having an event scheduler for same. By this it would be possible to 

Separate event scheduler and application.

> implement TTimer in a way that it's callbacks can be fired in the 
> context of a thread and thus "asynchronous timer event" are possible in 
> a completely compatible way, allowing the user to define, regarding what 
> context the event is asynchronous. IMHO this would be a great plus for 
> any embedded "real-time" use of FPC.

No, the timer will still be synchronous, only to the current thread's 
event handler, not to the main (GUI) one.

I don't see how async timers can be useful for software (maybe to 
control hardware perhaps, but only the trivial kind as well, no complex 
state allowed), as you cannot take any locks, and must be re-entrant. 
This implies you can almost call no function at all.


More information about the fpc-devel mailing list