Pumpkin, Inc.

Pumpkin User Forums

Correct way to restart waiting tasks?

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

Correct way to restart waiting tasks?

Postby DFx_Tech » Thu Sep 30, 2004 3:28 am

Hi,

Now that I'm back running again I've got a question related to restarting tasks.

I have four simple tasks that each wait on a binary semaphore, when signaled they toggle a port bit then use OS_Delay to sleep for 6 seconds and finaly un-toggle the bit before looping to wait on the semaphore again.

Sometimes these tasks will need to be restarted (the device has a global 'cancel' button) so some may be in OS_Delay() some may be waiting on their semaphore etc..

I have seen in the manual that OSDestroyTask() can't be used on a waiting task, so of course I tried it anyway and that resulted in serious wierdness with the tasks randomly 'locking up' as expected.

So, really my question is how can I completely nuke a running task in an unknown state so I can restart it?

Thanks,

Jon

DFx_Tech
 
Posts: 14
Joined: Tue Sep 07, 2004 11:00 pm
Location: Witney, Oxfordshire, England

Re: Correct way to restart waiting tasks?

Postby aek » Thu Sep 30, 2004 6:52 am

Hi Jon.

I will send you an example of a new Salvo function on Friday that completely kills a waiting task, irrespective of its state.

This "new and improved" OSDestroyTask() will also be in the v3.3 release.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Correct way to restart waiting tasks?

Postby lucicop2001 » Sun Jul 02, 2006 4:22 am

Hi aek,

Can you explain to me too how to destroy a waiting task, because I have the same problem with my code...

Thank you in advance !

Best regards,
Lucian

Lucian
lucicop2001
 
Posts: 40
Joined: Sun Jun 05, 2005 11:00 pm
Location: Bucharest, Romania

Re: Correct way to restart waiting tasks?

Postby lucicop2001 » Mon Jul 03, 2006 10:27 am

Hello Andrew,

Thank you very much for the code you sent me ! It is very helpful. With this occasion I want to thank you again for providing me the chance to work with Salvo, which is great and is helping me very much.

Many thanks and best regards,
Lucian Copat

Lucian
lucicop2001
 
Posts: 40
Joined: Sun Jun 05, 2005 11:00 pm
Location: Bucharest, Romania

Re: Correct way to restart waiting tasks?

Postby kamyip » Wed Sep 27, 2006 10:06 am

quote:
Originally posted by aek:
Hi Jon.

I will send you an example of a new Salvo function on Friday that completely kills a waiting task, irrespective of its state.

This "new and improved" OSDestroyTask() will also be in the v3.3 release.



Hi Andrew,

Can you send me the code as well? I am facing the same problem.

TQ ;-)

kamyip
 
Posts: 46
Joined: Mon Apr 15, 2002 11:00 pm

Re: Correct way to restart waiting tasks?

Postby kamyip » Thu Sep 28, 2006 5:35 am

thanks for the prompt response.

two thumbs up .....

kamyip
 
Posts: 46
Joined: Mon Apr 15, 2002 11:00 pm

Re: Correct way to restart waiting tasks?

Postby aek » Thu Sep 28, 2006 11:29 am

On its way to you via email ...

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 5 guests

cron