×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    3

    Exclamation Graceful Process Termination

    Hello!

    I need some expert comments regarding graceful process termination in Symbian.

    When a process is killed using RProcess::Terminate(), the process just goes down without doing any cleanup. My process has a session (RSyncMLSession), with an external SyncML engine. which is open for process lifetime. The executable is killed by a UI app using RProcess::Terminate(). The open SyncML session should be closed (using RSyncMLSession::Close()) by the process before dying.

    Where can I do this? Is there a pre-defined cleanup routine in Symbian executables (.exe) where I can put my cleanup code? Or can a signal handler (like in Unix) be defined to handle this?

    The process has an CActive Active Object and the Active Sscheduler is installed. I don't see the Cancel() routine of the Active Object called either, before the process goes down. So too doesn't seem like a good place to do this.

    Any other suggestion is also welcome.

    Thanks in advance,
    Aditya

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Graceful Process Termination

    Hi,

    I think if you kill your exe/precoess then you do not need to cleanup the stack.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    3

    Re: Graceful Process Termination

    Hi Jitendra,

    The cleanup is required to close an open connection with the SyncML Server (which is another process) to let it know that it's client is dying. Though, I'm doing this in the destructor of the Active Object, which is pushed to the Cleanup Stack. But when the exe is killed using RProcess::Terminate(), the Cleanup Stack is not rewound and the destructor is never called.

  4. #4
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Graceful Process Termination

    Hi,

    As per my understanding you are using client server macanizm where client should know that server id dying, if it is right what I am getting, then before killing the server process just send a message to client that server is dying.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  5. #5
    Registered User
    Join Date
    Jun 2009
    Posts
    3

    Re: Graceful Process Termination

    The client executable is killed externally by a UI (using RProcess::Terminate()). So it doesn't know that it is going to die. It just dies. The question is, whether there is a last minute cleanup mechanism supported by Symbian (similar to signal handlers in Unix), where some custom cleanup could be done.

    Alternatively, is there a way in which the UI can signal the executable to terminate itself (as opposed to forcefully killing it using RProcess calls).

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,692

    Re: Graceful Process Termination

    Terminate, Kill has immediate effect, and there are no signal handlers as far as I know. On the other hand, resources will not leak, the kernel notifies servers about the death of their client.

    If this mediator code happens to be a server in itself, you could add an "exit gracefully" function.

  7. #7
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: Graceful Process Termination

    u can watch a thread using RUndertaker
    or a process using RProcess::Logon

    this way the server can watch the client if it dies normally or otherwise...
    Amit Kankani
    Nokia Developer Champion

Similar Threads

  1. Replies: 2
    Last Post: 2009-03-13, 09:25
  2. Replies: 5
    Last Post: 2009-02-14, 16:02
  3. WaitDialog during synchronous process
    By jp4symbian in forum Symbian User Interface
    Replies: 5
    Last Post: 2008-07-16, 09:56
  4. Cannot create process on Emulator with Carbide and 3rd Edition Sdk
    By nroyer in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 3
    Last Post: 2007-07-09, 13:26
  5. Process termination check
    By prasanta_sadhukhan in forum Symbian
    Replies: 3
    Last Post: 2007-03-31, 16:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×