×
Namespaces

Variants
Actions

Archived:Python Threading recommendations

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Tested with
Devices(s): Nokia E63
Compatibility
Platform(s): S60 3rd Edition
Article
Keywords: threading,appuifw,thread,pys60
Created: User:Jdelalan (04 Apr 2010)
Last edited: hamishwillee (08 May 2013)

Contents

Overview

Given to the special handling of concurrent programming & UI in Symbian (active objects), you can't really develop a multi-threaded application as you would do it with a PC and a graphical toolkit.

1. You can use threads

Standard threading module is included in pys60, you can spawn threads « normally »

2. Only main thread uses appuifw

It's to say if you create threads using threading module, they can't do any drawing/ui operations.

Be aware of that, if you try to use appuifw function in a 3d-party thread, your script will crash (without displaying explicit error as far as I know).

3. use Ao_lock in main thread...

... Otherwise, each time you do a blocking acquire on a Lock/Semaphore/Event... from threading module, your UI will become unresponsive. For the same reason, use Ao_timer and ao_sleep for using delays (see API doc).

4. Main thread is the last to live

You should terminate all other threads before sending the end signal to the main thread.

This page was last modified on 8 May 2013, at 09:31.
31 page views in the last 30 days.
×