Commit 0e207a0
committed
Kernel / Library - Introduce thread & Memory poll to process and pull events
This is highly based on #307 without the async logic. The reason is to avoid using the kernel NotificationLoop that was dispatching requests to workers (userland thread) sequentially. It has a high cost to do a thread switch each time to wake up the workers.
The current logic is nice when you want workers to be async but as we have threads (and now a thread poll) dedicated to pull and process events, we can make them synchronously wait for new events and take them from the request list themself.
This commit introduces the logic of a single main thread that polls events by batch and dispatches them to other threads and keeps the last one for itself to process and send the response to the kernel. Each thread waken will do the same and pull new events at the same time. If none is returned, the thread goes back to sleep and otherwise does the same as the main thread (dispatch and process).
The difference is that the main thread waits indefinitely for new events while others wait 100ms in the kernel before returning back to userland.This and the memory poll also added, offer a great flexibility of resources especially on heavy load.
This CL is huge but the perf that comes with it are about 10-35% on sequential requests but in the real world with the thread poll the perf are way above.
@Corillian full rewrite of FindFiles improved the perf between 100-250%...1 parent c167bfc commit 0e207a0
File tree
40 files changed
+2803
-1769
lines changed- dokan_fuse
- include
- src
- dokan
- samples
- dokan_memfs
- dokan_mirror
- sys
- util
40 files changed
+2803
-1769
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 25 | + | |
| 26 | + | |
31 | 27 | | |
32 | | - | |
| 28 | + | |
33 | 29 | | |
34 | | - | |
35 | | - | |
| 30 | + | |
36 | 31 | | |
37 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
38 | 37 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 38 | + | |
42 | 39 | | |
43 | | - | |
44 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
45 | 43 | | |
46 | 44 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 45 | + | |
53 | 46 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 26 | + | |
| 27 | + | |
31 | 28 | | |
32 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 35 | | |
44 | 36 | | |
45 | 37 | | |
46 | 38 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
52 | 46 | | |
53 | | - | |
54 | | - | |
55 | 47 | | |
0 commit comments