I didn't remember exactly. I wrote some graphics functions maybe my own OpenGL GUI. I need some special effect. It needs to be run after certain object initialized, and they must run sequentially. I do not familiar with threads, I used events and TTimer (created runtime) heavily. My tricks worked as what I want. The key is, it must set a global variable when the task is finished.
What I can imagine now, for example in game programming. If the player (spaceship) drop a bomb, then I will send tasks like this:
1. Initialize the bomb
2. The bomb travels until it hits an object or ground
3. Explode
Events and ttimers is a pseudo asynchronous (or semi asynchronous?) environment. TTimer will add a message in the message queue of the application when it fires, as long as your application is in the loop of message processing it will process each message/event in the order they are received.
It is still a single thread executing in a linear manner it just gives the illusion of parallel execution just like a cothreads library in a single core processor would.
Global variables will help as long as they are atomic operations ee booleans or properly aligned 16, 32 bit etc set/get operations.
The moment you jump to something a bit more complex ee strings, arrays etc you will end up with a lot of problems with out a proper synchronization primitive (semaphore, mutex, critical sections or what ever they are called in the framework you are using, eg fpc has criticalsections instead of mutex)