Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 22:32, 12 October 2007.

How to create a daemon process

From Forum Nokia Wiki


This code create a daemon process.

import appuifw
import e32
import thread
 
lock = e32.Ao_lock()
lockTHR = thread.allocate_lock()
 
###### replace this function with what you want to execute
i = 0
def funcDaemon():
	global i
	while(1):
		lockTHR.acquire()
		e32.ao_sleep(1)
		open('E:\\Others\\tmp.txt', 'a').write(str(i)+"\n")
		i+=1
		lockTHR.release()
####################################################################
 
appuifw.app.title = u'DaemonS60'
appuifw.app.exit_key_handler = lambda:lock.signal()
 
print 'DaemonS60 - Start'
 
thread.start_new_thread(funcDaemon, ())
 
lock.wait()
 
print 'DaemonS60 - Stop'
Related Discussions
Thread Thread Starter Forum Replies Last Post
Carbide.c++ 1.2 - small on-device debugging issues and workarounds jplauril Carbide.c++ and CodeWarrior Tools 4 2007-05-09 15:24
Re:RMS Storing of PNG File quaseer Mobile Java General 1 2004-01-29 14:25
icons creation and Flash Lite biskero Tools and SDK Feedback 1 2006-08-01 12:39
如何调用一个app程序 wxk0808 Symbian 2 2005-08-03 03:37
Custom Scheduler in Process?? mayur_24 General Symbian C++ 0 2004-07-19 14:51
 
Powered by MediaWiki