Wait until deadline variant
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- wasm
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Issue không nêu tên tệp hay bài kiểm thử nào. Hãy bắt đầu bằng cách đọc dependency #230, sau đó xem lại phần thảo luận của đề xuất về Atomics.waitAsync và việc chờ tuyệt đối so với chờ tương đối trên các hệ điều hành và phần cứng nhúng khác nhau. Kết quả cần là một biến thể chờ dựa trên thời hạn được đặc tả với ngữ nghĩa rõ ràng và mối quan hệ của nó với dạng hiện có dựa trên khoảng thời lượng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This obviously depends on #230.
Waiting for a duration is useful for simple blocking waits, but event loops generally find deadlines more convenient to work with, since you can just throw all the deadlines into a heap, sort by deadline, and (if your loop is multi-threaded) make your wait condition include timer add/remove events. Browser runtimes would already likely need a similar model anyways because of Atomics.waitAsync, but it's easy for a runtime using one model to expose the other.
Also, the type of wait differs heavily between platforms, with some accepting absolute deadlines, some accepting relative timeouts, and some accepting both:
- Operating systems:
- Linux: all futex waits other than
FUTEX_WAITuse absolute deadlines, and even that one has an absolute alternative documented in its manpages. - Fuschia only uses absolute deadlines in its
zx_futex_waitsyscall, and offers no relative equivalent. - macOS provides both
os_sync_wait_on_address_with_deadlineandos_sync_wait_on_address_with_timeout. - OpenBSD and Windows only offer relative timeouts in their APIs.
pthread_condvar_timedwaitonly uses absolute timeouts.
- Linux: all futex waits other than
- Embedded hardware:
- 32-bit ARM's SysTick is effectively timeout-based. It decrements every tick until it hits zero, in which it then triggers an interrupt. Setting the register essentially sets the number of ticks to wait before sending the interrupt.
- RISC-V's privileged spec uses
*timecmpregisters corresponding to*timetargets and triggers an interrupt whenever they're equal, effectively using a deadline-based system. - x86-64's HPET works nearly identically to RISC-V's mechanism. (This mostly only has relevance for VM-based server-side runtimes.)
- The real-time clock specified by ACPI for motherboards uses deadlines. (This is sometimes used on high-end microcontrollers.)
Will note that it's easy to do one in terms of the other.
- If all waits are absolute, relative waits are as simple as using a deadline of
current_time() + timeout. - If all waits are relative, absolute waits are as simple as using a timeout of
max(target_time - current_time(), 0).
- Ngôn ngữ chính
- WebAssembly
- Star
- 767
- Fork
- 54
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của WebAssembly/threads
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
WebAssembly/threads#254 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
WebAssembly/threads#253 · 6 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
WebAssembly/threads#245 · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
WebAssembly/threads#240 ·
-
Branch renaming Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 20/100
WebAssembly/threads#237 ·
Tất cả issue của WebAssembly/threads
Issue tương tự
-
Bug Good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
johnsonjh/emu2-cpm86#61 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
arduino/arduino-app-lab#49 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
zephyrproject-rtos/zephyr#120011 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
ValveSoftware/Proton#10167 ·