Custom Search

Sunday, January 3, 2010

PyS60 Tutorial Basic note

Concurrency Aspects
--------------------------------
The thread that initializes the Python interpreter becomes the main Python thread. This is usually the main thread of a UI application.
When an application written in Python launches, the Symbian platform infrastructure creates the main UI thread that starts the Python
environment. If a Python program is started as a server with e32.start_server, then the Python main thread is not a UI thread.

A facility called active object is used extensively on the Symbian OS to implement co-operative, non-preemptive scheduling within
operating system threads. This facility is also utilized with native APIs.
The main execution path of a UI script is blocked in wait for an active object to complete – either explicitly as a result of using
e32.Ao_lock, or indirectly within some other Python API implementation – the UI-related callbacks may still get called.

The standard thread.lock cannot normally be used for synchronization in the UI application main thread, as it blocks the UI event
handling that takes place in the same thread context. The Symbian active object based synchronization service called e32.Ao_lock
has been implemented to overcome this problem. The main thread can wait in this lock, while the UI remains responsive.


Usage of Unicode
-------------------------
Series 60 extensions generally accept both plain strings and Unicode strings as arguments, but they return only Unicode strings.
APIs that take string arguments for the purpose of showing them on the UI expect Unicode strings. Giving something else may
result in garbled appearance of the text on the screen.

Date and Time
---------------------
Unix time, seconds since January 1, 1970, 00:00:00 UTC (Coordinated Universal Time), is generally used as the time format in the
Python for Series 60 APIs described in this document. The float type is used for storing time values.

No comments:

Post a Comment