can i have a 2 tasks call the same function at the same time!!
Logged In: YES
Only if you upgrade to b31 and mark your function as inline or safecall. Your best bet is to mark the function as inline since that will allow both tasks to execute the code in your inline function simultaneously. If you mark your function as safecall then one of the two tasks will execute the function first and the other will have to wait until the function returns to the first task. In many situations this behavior is fine.
If you use shared resources such as motors or sensor ports within your function then you will not get simultaneous execution.
Use this syntax with the new NXC beta release (b31):
inline int MyFunc(int x, int y)
int value = MyFunc(2, 5);
int value2 = MyFunc(12, 5);