Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
How do I suspend other tasks

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
FFMan



Joined: 09 Jan 2010
Posts: 223

Posted: 09 January 2010, 21:20 PM    Post subject: How do I suspend other tasks Reply with quote

New zx24 convert, came about trying to get bx24 to do some stuff and having a battle - ported the code to zx24 and it works first time - happyt convert !

My program has 2 extra tasks running. The main program may at some point want to stop or suspend the other tasks while config changes are made.

What is the best way to achieve this ?
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 09 January 2010, 23:25 PM    Post subject: Re: How do I suspend other tasks Reply with quote

FFMan wrote:
The main program may at some point want to stop or suspend the other tasks while config changes are made.
It may be as simple as locking the task from which the changes are to be made. When a task is locked, the task switcher won't switch to another task due to an RTC tick. It is important to note, however, that if the other tasks are awaiting an external interrupt or an input capture completion and those events occur, the waiting task will still be activated even if the current task is locked.

Moreover, you must be careful not to invoke Sleep(), Delay() or similar System Library routines because those will implicitly unlock the calling task. If delays are needed in a locked task, PulseOut() can be used (for short delays) or the delay may be implemented by monitoring the value of Register.RTCTick.

An alternative is to invoke ExitTask() to cause a task to terminate. Then, after reconfiguration you can re-launch the task using CallTask().
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group