Multi-threading functions

I am planing to learn and write some functions using multi-threading technique in C++.
Is there any conditions for a function to be converted from single thread to multi-thread one?
For example, can I convert all functions (cin, cout,...) to multi-thread ones?
Last edited on
cin/cout are not functions. They are global variables.
If variables are shared across threads the need protection like a mutex:

http://www.cplusplus.com/reference/mutex/mutex/?kw=mutex

atomic:

http://www.cplusplus.com/reference/atomic/atomic/?kw=atomic


Generally: standard container and streams are not thread safe:

http://stackoverflow.com/questions/261683/what-is-meant-by-thread-safe-code
Topic archived. No new replies allowed.