2 cogs running the same object

Hi,
1. If 2 cogs runs different methods of one object, and both cogs actively changes values of global variables in that object,
would we need semaphores to prevent program crashes?
2. What is the safest stack size value that you would recommend to beginners?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
1. If 2 cogs runs different methods of one object, and both cogs actively changes values of global variables in that object,
would we need semaphores to prevent program crashes?
2. What is the safest stack size value that you would recommend to beginners?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
Comments
2. As big as you can make it
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Michael Park
PS, BTW, and FYI:
To search the forum, use search.parallax.com (do not use the Search button).
Check out the Propeller Wiki: propeller.wikispaces.com/
There a special case of multiprocessor operation where only one processor writes to a shared value, but multiple processors can read it. A FIFO buffer is one case of this where one processor is a producer of values and another processor is a consumer of values. This can be implemented as two single producer / single consumer variables, the buffer pointer used for writing to the buffer and the pointer used for reading from the buffer. A lock is not necessary for this mechanism.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Michael Park
PS, BTW, and FYI:
To search the forum, use search.parallax.com (do not use the Search button).
Check out the Propeller Wiki: propeller.wikispaces.com/