Hi Nicolas, thanks for the answer.

As you said, the "process_exit" plus "process_start" combination works for restarting a process. Nevertheless, I had some troubles when implementing this simple procedure because of a reason that may be worth a discussion (it may help another newbies as me).

My processes were implemented according to the skeleton indicated here: http://www.sics.se/contiki/developers/skeleton-code-for-contiki-a-process.html. However, such processes did not break the 'while(1)' loop when the 'process_exit' function was called (i.e., inside PROCESS_WAIT_EVENT_UNTIL I did not react in front of a PROCESS_EVENT_EXIT). Consequently, the processes were stopped ( shaved off the PROCESS_LIST() ) when I called 'process_exit', but they were somehow "frozen" when I restarted them by calling 'process_start' again ( still they were put back in the PROCESS_LIST() ).

After I include 'break;' inside the while loop of the processes, in front of the event PROCESS_EVENT_EXIT, everything works just fine.

A bit of the working code:


PROCESS_WAIT_EVENT_UNTIL( etimer_expired(&timer) || ev == PROCESS_EVENT_EXIT );

    if ( ev == PROCESS_EVENT_EXIT ) break;




On Sat, Oct 18, 2008 at 9:58 PM, Nicolas Tsiftes <nvt@sics.se> wrote:

You can restart your process with process_exit() and process_start().
The process can also be paused in a few different ways, depending on how
you want to re-enable it. One option is to use
The process will be woken up when calling process_post(&my_process,


Ricardo Franco Mendoza García skrev:
> Hi everyone in the list.
> I am new to Contiki, but I have read a lot about it last days.
> Nevertheless, I haven't been able to find the answer to the question
> about restarting a process, so I hope you can help me.
> Assuming that I have a process called "my_process", can I do:
> /*******************************************/
> process_start(&my_process, NULL);
> ... some code ...
> process_exit(&my_process);
> ... some code ...
> process_start(&my_process, NULL);
> /******************************************/
> ?
> If not possible, is there any way to "pause" a process indefinitely
> (and then to resume it)?
> Any hint would be very welcome.
> Regards...
> Franco.

This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Contiki-developers mailing list

Ricardo Franco Mendoza Garcia