summaryrefslogtreecommitdiffstats
path: root/util/thread/pool.cpp
Commit message (Collapse)AuthorAgeFilesLines
* better fork-aware poola11ax2025-05-221-7/+14
| | | | | | | | | Было: при добавлении-удалении обьекта берем мьютекс, молимся чтобы тот не оказался залочен при форке, никак перед форком на лок не смотрим Помимо того что это просто не очень надежно, оно не всегда работает. Может случиться так что с мьютексом все нормально, но IntrusiveList все равно [скорапчен](HIDDEN_URL и список закольцован не там где надо (по всей видимости cpu reorder на apple m1 ехидничает). Стало: берем спинлок вместо мьютекса, в том числе берем его на время форка. commit_hash:94145ab392390a2c0b9f885275302082524606b2
* Add an option to disable the fork aware mode for TThreadPoolandybg2025-03-281-2/+8
| | | | | | | | | | | | | Продолжение починки крэшей при форке Ситуация такая же - используем subprocess для обработки данных ( subprocess не наши, написаны множеством команд на нескольких языках под конкретные ситуации), быстро избавиться от форка не получится. Есть шанс избавиться от этого пул треда, но тоже не быстро. Предлагается простое решение - не вызывать `TAtforkQueueRestarter::Get()`совсем, тогда не будет создание singletonа и вызова `pthread_atfork`. Все это под опцией `SetForkAware` - кто хочет может ее включать, для всех остальных ничего не изменится. Полная обратная совместимость, фикс ничего не мог зацепить. Проверил локально, вызова `pthread_atfork` нет в `unified agent` больше. Тесты на это очень сложно написать, без больших изменений в тред пуле, пробовал с перехватом `pthread_atfork`, к сожалении, не только `TAtforkQueueRestarter` им пользуется и нормально перехватить тоже не получилось. commit_hash:3711c6175ca64564f31f811ee1308d70ef6eb5e3
* FixNamespaceComments in /utildmasloff2024-09-051-3/+3
| | | | | FixNamespaceComments in /util bb9152570d7c258798644ead5a59f604de05ef3b
* Set SpacesInLineCommentPrefix to 1 in /utildmasloff2024-08-171-1/+1
| | | | | Set SpacesInLineCommentPrefix to 1 in /util 3853f9ec5143722c1bebd8dc0ffc9b61a6c17657
* Library import 6 (#888)AlexSm2024-01-091-1/+1
|
* Y_VERIFY->Y_ABORT_UNLESS at ^uilnurkh2023-10-101-1/+1
| | | | https://clubs.at.yandex-team.ru/arcadia/29404
* [util] Terminate instead of deadlock after fork with running thread poolssskvor2022-11-101-4/+8
| | | | | Контекст. В древнем странном коде обнаружили, что если создавать `TThreadPool` часто и конкуретно с запуском `TShellCommand`, то иногда последняя дедлочится: если начали выполнять конструктор `TThreadPool` и регистрацию в `TAtforkQueueRestarter`, захватив `TAtforkQueueRestarter::ActionMutex`, а в другом потоке параллельно сделали `fork`, то последний может форкнуться с залоченым мьютексом. Первым делом происходит вызов коллбеков из `pthread_atfork`, где мьютекс лочится заново. Конечно, форкаться в сложных программах с тредпулами категорически запрещено, но, подозреваю, много кода в аркадии так написано. Давайте как-то защитимся от такого.
* IGNIETFERRO-1105 Get rid of TAtomic in thread/pool.cppeeight2022-05-171-7/+7
| | | | ref:3fa56aa890b75b7301a3193c2ee40106281a71cb
* IGNIETFERRO-1105 TAtomic -> std::atomic in util/generic/* and threadpooleeight2022-05-111-10/+9
| | | | ref:39a714b781c60dca9e3b946d870971076e14ab7c
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.seege2022-02-101-12/+12
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.seege2022-02-101-12/+12
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.sievlev2022-02-101-9/+9
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.sievlev2022-02-101-9/+9
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.onpopov2022-02-101-2/+2
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.onpopov2022-02-101-2/+2
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.grig2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.grig2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.fippo2022-02-101-3/+3
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.fippo2022-02-101-3/+3
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.khlebnikov2022-02-101-5/+5
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.khlebnikov2022-02-101-5/+5
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.alex-sh2022-02-101-7/+7
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.alex-sh2022-02-101-7/+7
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.tender-bum2022-02-101-7/+7
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.tender-bum2022-02-101-7/+7
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.ivanzhukov2022-02-101-25/+25
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.ivanzhukov2022-02-101-25/+25
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.anelyubin2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.anelyubin2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.trofimenkov2022-02-101-86/+86
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.trofimenkov2022-02-101-86/+86
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.kimkim2022-02-101-4/+4
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.kimkim2022-02-101-4/+4
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.spacelord2022-02-101-21/+21
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.spacelord2022-02-101-21/+21
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.vmordovin2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.vmordovin2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.melkov2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.melkov2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.nga2022-02-101-2/+2
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.nga2022-02-101-2/+2
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.paxakor2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.paxakor2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.tobo2022-02-101-7/+7
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.tobo2022-02-101-7/+7
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.gusev-p2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.gusev-p2022-02-101-1/+1
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.agorodilov2022-02-101-5/+5
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.agorodilov2022-02-101-5/+5
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.yazevnul2022-02-101-9/+9
|