Yingchun Lai
b780df697a
[refactor] Optimize threads usage mode in BE ( #4440 )
...
BE can not graceful exit because some threads are running in endless
loop. This patch do the following optimization:
- Use the well encapsulated Thread and ThreadPool instead of std::thread
and std::vector<std::thread>
- Use CountDownLatch in thread's loop condition to avoid endless loop
- Introduce a new class Daemon for daemon works, like tcmalloc_gc,
memory_maintenance and calculate_metrics
- Decouple statistics type TaskWorkerPool and StorageEngine notification
by submit tasks to TaskWorkerPool's queue
- Reorder objects' stop and deconstruct in main(), i.e. stop network
services at first, then internal services
- Use libevent in pthreads mode, by calling evthread_use_pthreads(),
then EvHttpServer can exit gracefully in multi-threads
- Call brpc::Server's Stop() and ClearServices() explicitly
2020-09-06 20:19:14 +08:00
..
2020-07-10 18:37:36 +08:00
2020-09-03 16:57:56 +08:00
2018-11-02 10:22:32 +08:00
2020-07-31 21:57:21 +08:00
2020-02-20 20:43:26 +08:00
2020-08-26 10:51:52 +08:00
2020-08-26 10:51:52 +08:00
2020-05-08 12:49:48 +08:00
2020-05-08 12:49:48 +08:00
2020-08-04 12:55:53 +08:00
2020-08-04 12:55:53 +08:00
2020-07-31 21:57:21 +08:00
2020-02-20 20:43:26 +08:00
2020-06-23 13:42:22 +08:00
2020-05-21 13:00:49 +08:00
2020-08-26 10:53:53 +08:00
2020-07-03 21:18:47 +08:00
2020-08-04 12:55:53 +08:00
2019-08-19 12:23:43 +08:00
2019-09-28 00:11:43 +08:00
2020-05-25 21:24:56 +08:00
2020-06-23 13:42:22 +08:00
2020-06-23 13:42:22 +08:00
2020-06-23 13:42:22 +08:00
2020-07-31 21:57:21 +08:00
2018-11-02 10:22:32 +08:00
2020-07-31 21:57:21 +08:00
2020-07-13 20:54:31 +08:00
2019-06-14 23:38:31 +08:00
2018-11-02 10:22:32 +08:00
2020-07-31 21:57:21 +08:00
2020-07-31 21:57:21 +08:00
2019-08-27 14:13:47 +08:00
2019-06-07 22:26:54 +08:00
2019-06-14 23:38:31 +08:00
2018-11-02 10:22:32 +08:00
2020-07-31 21:57:21 +08:00
2020-04-13 23:07:33 +08:00
2020-07-31 21:57:21 +08:00
2020-07-31 21:57:21 +08:00
2020-08-26 10:51:52 +08:00
2020-02-20 23:47:02 +08:00
2020-08-18 09:23:48 +08:00
2020-04-01 20:58:43 +08:00
2020-06-22 09:20:22 +08:00
2019-12-19 16:40:33 +08:00
2020-07-31 21:57:21 +08:00
2020-07-31 21:57:21 +08:00
2020-05-21 13:00:49 +08:00
2019-09-28 00:11:43 +08:00
2020-03-20 10:31:14 +08:00
2020-08-21 19:55:09 +08:00
2020-03-20 10:31:14 +08:00
2020-07-31 21:57:21 +08:00
2020-07-31 21:57:21 +08:00
2020-03-17 10:54:40 +08:00
2020-07-31 21:57:21 +08:00
2020-04-01 20:58:43 +08:00
2020-08-26 10:53:53 +08:00
2020-07-30 10:36:34 +08:00
2018-11-02 10:22:32 +08:00
2020-05-21 13:00:49 +08:00
2020-05-21 13:00:49 +08:00
2019-09-28 00:11:43 +08:00
2020-05-25 21:24:56 +08:00
2019-06-14 23:38:31 +08:00
2019-06-14 23:38:31 +08:00
2020-07-31 21:57:21 +08:00
2020-08-26 10:51:52 +08:00
2020-08-26 10:51:52 +08:00
2020-07-31 21:57:21 +08:00
2018-11-02 10:22:32 +08:00
2019-06-14 23:38:31 +08:00
2019-06-05 12:28:15 +08:00
2019-09-04 21:05:12 +08:00
2020-08-26 10:51:52 +08:00
2020-07-31 21:57:21 +08:00
2019-03-22 17:22:16 +08:00
2020-08-27 12:07:21 +08:00
2020-08-27 12:07:21 +08:00
2020-09-04 10:10:17 +08:00
2020-07-03 21:33:07 +08:00
2019-03-22 17:22:16 +08:00
2020-08-17 22:55:29 +08:00
2020-08-17 22:55:29 +08:00
2020-07-13 20:54:31 +08:00
2020-03-17 17:30:42 +08:00
2020-08-18 16:54:55 +08:00
2020-08-18 16:54:55 +08:00
2020-05-25 21:24:56 +08:00
2020-05-25 21:24:56 +08:00
2020-04-01 18:48:18 +08:00
2020-07-31 21:57:21 +08:00
2020-05-16 21:35:30 +08:00
2020-03-20 19:59:01 +08:00
2020-07-31 21:57:21 +08:00
2020-07-31 21:57:21 +08:00
2020-03-20 19:59:01 +08:00
2019-06-14 23:38:31 +08:00
2018-11-02 10:22:32 +08:00
2019-06-14 23:38:31 +08:00
2018-11-02 10:22:32 +08:00
2018-11-02 10:22:32 +08:00
2019-06-14 23:38:31 +08:00
2020-07-31 21:57:21 +08:00
2020-02-12 21:50:12 +08:00
2018-11-15 16:17:23 +08:00
2020-06-13 16:25:40 +08:00
2020-06-13 16:25:40 +08:00
2018-11-01 09:06:01 +08:00
2020-07-31 21:57:21 +08:00
2018-11-02 10:22:32 +08:00
2019-06-14 23:38:31 +08:00
2019-12-06 17:45:56 +08:00
2020-07-31 21:57:21 +08:00
2018-11-02 10:22:32 +08:00
2020-07-31 21:57:21 +08:00
2020-04-23 09:35:41 +08:00
2020-07-31 21:57:21 +08:00
2020-07-31 21:57:21 +08:00
2020-07-31 21:57:21 +08:00
2018-11-02 10:22:32 +08:00
2020-07-31 21:57:21 +08:00
2020-07-31 21:57:21 +08:00
2020-09-06 20:19:14 +08:00
2020-09-06 20:19:14 +08:00
2019-08-27 22:15:46 +08:00
2019-08-27 22:15:46 +08:00
2020-03-24 10:52:57 +08:00
2020-07-31 21:57:21 +08:00
2020-08-26 10:51:52 +08:00
2020-08-26 10:49:32 +08:00
2020-08-26 10:49:32 +08:00
2020-08-26 10:49:32 +08:00