MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / ThreadPools_CreatePools

Function ThreadPools_CreatePools

src/util/thpool/pools.c:41–59  ·  view source on GitHub ↗

set up thread pools (readers and writers) returns 1 if thread pools initialized, 0 otherwise

Source from the content-addressed store, hash-verified

39// set up thread pools (readers and writers)
40// returns 1 if thread pools initialized, 0 otherwise
41int ThreadPools_CreatePools
42(
43 uint reader_count,
44 uint writer_count,
45 uint64_t max_pending_work
46) {
47 ASSERT(_readers_thpool == NULL);
48 ASSERT(_writers_thpool == NULL);
49
50 _readers_thpool = thpool_init(reader_count, "reader");
51 if(_readers_thpool == NULL) return 0;
52
53 _writers_thpool = thpool_init(writer_count, "writer");
54 if(_writers_thpool == NULL) return 0;
55
56 ThreadPools_SetMaxPendingWork(max_pending_work);
57
58 return 1;
59}
60
61// return number of threads in both the readers and writers pools
62uint ThreadPools_ThreadCount

Callers 4

ThreadPools_InitFunction · 0.85
setupFunction · 0.85
setupFunction · 0.85

Calls 2

thpool_initFunction · 0.85

Tested by 3

setupFunction · 0.68
setupFunction · 0.68