Effects of combinable

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
teachop
Active Member
Posts: 47
Joined: Wed Feb 05, 2014 1:25 am

Effects of combinable

Post by teachop »

If a task is marked [[combinable]] but [[combine]] isn't used to start the function, does it change anything?

I am thinking of certain driver task functions that could in most situations cooperatively multitask and still work properly. It seems courteous to mark them [[combinable]] whenever they meet the requirements so that users have the option.

Is there any down side to doing this?


richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Post by richard »

teachop wrote:If a task is marked [[combinable]] but [[combine]] isn't used to start the function, does it change anything?

I am thinking of certain driver task functions that could in most situations cooperatively multitask and still work properly. It seems courteous to mark them [[combinable]] whenever they meet the requirements so that users have the option.

Is there any down side to doing this?
If a task is marked as [[combinable]] then the compiler will create two versions of the function. If you only end up using one of these versions then the other will be eliminated at link time. As such there should be no problem marking the function as combinable (and it is probably good practice), but you might see a slight compilation time hit.
teachop
Active Member
Posts: 47
Joined: Wed Feb 05, 2014 1:25 am

Post by teachop »

Thank you, that is a nice implementation. Interesting too, I imagine [[distributable]] does the same thing?
richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Post by richard »

teachop wrote:Thank you, that is a nice implementation. Interesting too, I imagine [[distributable]] does the same thing?
Yes, if you mark a function as distributable the compiler will also produce different versions.
Post Reply