Commit 6eb581f
authored
Fix issues in the libc-wasi
Fix issues in the libc-wasi `poll_oneoff` when thread manager is enabled:
- The exception of a thread may be cleared when other thread runs into
`proc_exit` and then calls `clear_wasi_proc_exit_exception`, so should not
use `wasm_runtime_get_exception` to check whether an exception was
thrown, use `wasm_cluster_is_thread_terminated` instead
- We divided one time poll_oneoff into many times poll_oneoff to check
the exception to avoid long time waiting in previous PR, but if all events
returned by one time poll are all waiting events, we need to continue to
wait but not return directly.
Follow-up on bytecodealliance#1951. Tested with multiple timeout values, with and without
interruption and measured the time spent sleeping.poll_oneoff when thread-mgr is enabled (bytecodealliance#1980)1 parent f4107a9 commit 6eb581f
File tree
4 files changed
+40
-25
lines changed- core/iwasm/libraries
- libc-wasi
- sandboxed-system-primitives/src
- thread-mgr
4 files changed
+40
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
| |||
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 54 | + | |
62 | 55 | | |
63 | 56 | | |
64 | 57 | | |
| |||
989 | 982 | | |
990 | 983 | | |
991 | 984 | | |
992 | | - | |
| 985 | + | |
993 | 986 | | |
994 | | - | |
| 987 | + | |
995 | 988 | | |
996 | | - | |
997 | | - | |
998 | | - | |
| 989 | + | |
| 990 | + | |
999 | 991 | | |
1000 | 992 | | |
1001 | 993 | | |
| |||
1004 | 996 | | |
1005 | 997 | | |
1006 | 998 | | |
| 999 | + | |
| 1000 | + | |
1007 | 1001 | | |
1008 | 1002 | | |
1009 | 1003 | | |
| |||
1021 | 1015 | | |
1022 | 1016 | | |
1023 | 1017 | | |
1024 | | - | |
1025 | | - | |
1026 | 1018 | | |
1027 | 1019 | | |
1028 | 1020 | | |
1029 | 1021 | | |
1030 | 1022 | | |
| 1023 | + | |
| 1024 | + | |
1031 | 1025 | | |
1032 | 1026 | | |
1033 | 1027 | | |
1034 | 1028 | | |
1035 | 1029 | | |
1036 | | - | |
| 1030 | + | |
1037 | 1031 | | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
1038 | 1042 | | |
1039 | | - | |
| 1043 | + | |
| 1044 | + | |
1040 | 1045 | | |
1041 | 1046 | | |
1042 | | - | |
1043 | 1047 | | |
1044 | 1048 | | |
1045 | 1049 | | |
| |||
1069 | 1073 | | |
1070 | 1074 | | |
1071 | 1075 | | |
1072 | | - | |
1073 | | - | |
| 1076 | + | |
| 1077 | + | |
1074 | 1078 | | |
1075 | 1079 | | |
1076 | 1080 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2613 | 2613 | | |
2614 | 2614 | | |
2615 | 2615 | | |
| 2616 | + | |
| 2617 | + | |
2616 | 2618 | | |
2617 | 2619 | | |
2618 | 2620 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1198 | 1198 | | |
1199 | 1199 | | |
1200 | 1200 | | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| |||
0 commit comments