Unix thread restriction before affecting performance

I have some questions regarding threads:

  • What is the maximum number of threads allowed for a process before it reduces application performance?
  • If there is a limit, how can this be changed?
  • Is there an ideal number of threads to run in a multi-threaded application? If it depends on what the application does, can you give an example?
  • What are the factors to consider affecting performance / thread limitation?
+3
source share
6 answers

, , :

  • . , .

  • , , , , . ( , , .)

  • "" , . :

    • .
    • ( ) (, , , ..).
    • ( ).
    • .
    • .
  • , , :

    • ( , )
    • ( , ).
    • ( , .)
    • ( ?) ?)
    • . (Coroutines, , , ..).
    • . ( /? ? ..).
    • Etc. ( , .)
+2

, , . , . 256, , .

+1

1, 3 4 " ". , , , .

2, , , . , .

+1
  • : , . - - .
  • , .
  • , . , -, , , , .
  • , , . : , /. concurrency, , shared-nothing (. Erlang).
+1

, , , , , -, , , , , , IO, , /, 1 ( ).

PTHREAD_THREADS_MAX . , . POSIX_THREAD_MAX .

+1

While threads are designed to perform individual tasks, there are not many problems. However, the problem begins when these flows intersect with resources, when the locking mechanism must be implemented.

+1
source

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


All Articles