CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

RTOS Tasks

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
waheed



Joined: 19 May 2012
Posts: 26
Location: Pakistan

View user's profile Send private message

RTOS Tasks
PostPosted: Sat Jun 02, 2012 7:33 am     Reply with quote

Is there any limitation to how much tasks can be used in a program? I am writing a program that uses 7 tasks but only 3 tasks are running at a time.
When I include 8th task it gives strange behaviour. (Keep switching between the task), even if the 8th task does nothing except incrementing a variable.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Jun 04, 2012 2:56 am     Reply with quote

I don't know what the maximum number of allowed tasks is, but 7 sounds like a possible maximum. For an exact answer you'll have to mail CCS Support.

Just a few hints though:
1) The CCS RTOS feature is not used widely, i.e. you are in new territory and it is very well possible you will discover new bugs.
2) From doing I've learned that it is bad practice to create an application with many threads. Debugging becomes much more complicated as most debuggers and processors have poor support for multi-threading. Not to mention the problem of race conditions and dead locks which can be a real nightmare to track down.

Are you really sure you need threads? Or is it just a nice way for partitioning your program?
The fact that only 3 out of 7 tasks will be active at any given time suggests the latter. Partitioning a program into seperate parts is a Design Time problem and can be solved by creating multiple C-files / functions.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Mon Jun 04, 2012 2:40 pm     Reply with quote

Quote:
even if the 8th task does nothing except incrementing a variable.

If you must use RTOS, why not merge task8 with other tasks?

Mike
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group