When to use the function of combining streams with a stream?

I recently managed to create a stream using the boost :: bind function.

I currently have a stream mapping in stdout. I can see the result if I use thread.join. However, if I do not, I do not see a way out.

Why is this?

I hope that I do not need to use the join function, because I would like to call this function several times, without waiting for the completion of the previously launched thread.

Thank you for your responses. I really wanted to make sure the thread was actually executed. So I added a system call to touch a nonexistent file, and it was there after that, so the thread was executing.

+3
source share
2

, thread.join. , , . ?

, , . '\n' / endl ? (endl ).

join, , , . (, , ), .

, , . , , ( ), :

  • cout/stdout
  • \n fflush(stdout) ( - C-style) std::endl
+3

, , STDOUT , ?

, ++ 0x ( boost), (. ).

.. , ++ 11 , .

+3

Source: https://habr.com/ru/post/1707230/


All Articles