What should I know about multithreading and when to use it, mainly in C ++

I have never met multithreading, but I hear about it everywhere. What should I know about this and when to use it? I code mostly in C ++.

+3
source share
8 answers

Basically, you need to learn about MT libraries in the OS on which your application should run. Until C ++ 0x becomes a reality (this is far from the case now), there is no language support or a standard library for streams. I suggest you take a look at the standard POSIX pthreads library for * nix and Windows threads to get started.

+6
source

, , . , . concurrency, , . , concurrency . - . API concurrency (, Apple Core Animation).

( , ), , , .

+2

MSDN , , . Microsoft, Microsoft ( 1993 ), , ..

+2

.

...

  • . , .
  • . . , , , .
  • .

API- . - . wxWidgets ( ) - . , , API- .

+2

POSIX ( ), . pthread, .

, , . , , .

+1

, .

, , , , .

+1

, , , .

. , , . , - . , -, , , ui. .

, . ", ", , . , ui , .

cpu - , ( ). , . ui , , 2 . , , .

, , ui (), , , ui .

. PostMessage, ui, .

, ( ), , , ,

. , , , , . , , . , , , .

0

, . , , , . - , sqlite, , thread are evil. .

Chrome , , Stackless Python, "micro -". , -, , , .

, : . , , . . , , , , . , , , .

++ :

  • d . .
  • , Java.

- , boost Threads . ++ 0x . boost , , .

, , , , 99% .

If after all this you are still interested in starting the long difficult path to writing a multi-threaded C ++ program that will not be random, then I recommend starting with Increase Threads . They are well documented, at a high level and work on a cross-platform. Concepts (mutexes, locks, futures) are the same key concepts that are present in all thread libraries.

0
source

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


All Articles