Lilypad Bridge Start-up and Termination

Application Start-Up

When the application starts up the bridge is set up as illustrated in the figure that follows. Symbols written in normal face are implemented in the source code files for the core and symbols written in bold face are implemented in source code files of the GUI/lilypad. When the startup sequence is complete, the main thread will be running the entire GUI layer with an event loop managed by Cocoa, and the "alt thread" will be running the core of the application with an event loop managed by Qt. Grey-ish areas represent intervals where the corresponding thread is blocked waiting for something.

Invoking Methods Through the Bridge

When the application start-up sequence finishes and the event loops for the two threads are running, the bridge is ready to be used to pass messages that represent method invocations in both directions.

Description of the message format is forthcoming.

Every integer passed inside those messages is encoded using big-endian byte order.

Application Termination

The application termination sequence is triggered by the GUI side by invoking the method "systemQuit" over the bridge. When this request is received on the other side, the core will shutdown. At a certain point during this shutdown of the core, it will call platform_stop() (and consequently mac_platform_stop()) on its own thread (the Alt Thread). This is the call that signals to the GUI that the core has finished cleaning up and that the application should now terminate. This also implies that platform_deinit() will never be called, since the application terminates immediately on the call to platform_stop().

Attachments