Shouldn't this also be paired with a monotonic time opcode?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- wasm
- Ambito
- operating-systems
Direzione di ricerca
Inizia con i wait opcodes esistenti nell’Overview.md della proposta sui threads e verifica le API dell’orologio della piattaforma elencate qui. Determina se debba essere previsto un monotonic clock opcode insieme a essi e documenta l’API proposta e la rappresentazione temporale prevista. Il lavoro è completato quando la proposta presenta un design risolto invece di una domanda aperta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Sleep timers are normally batched for performance, with durations turned into deadlines, and effective batching requires tracking a monotonic clock to know precisely how long to wait for. In fact, processors normally mandate such batching at the operating system level. And this primitive is implemented on every platform, from embedded CPUs to high-performance operating systems, as it's a strict necessity.
Here's the API on various relevant platforms:
- Operating systems:
- Most Unix-like:
clock_gettime(CLOCK_MONOTONIC, &tv); - Linux:
clock_gettime(CLOCK_BOOTTIME, &tv); - Windows:
QueryInterruptTime(&ticks);
- Most Unix-like:
- The ACPI timer can be used as a clock reference even on older desktops.
- Processors:
- x86, x86-64: HPET,
rdtsc * base frequencyon modern processors - ARM: Generic Timer system register
- RISC-V: memory-mapped
mtime - AVR doesn't natively, but real-time clock peripherals are pervasive, and Arduinos have them built-in.
- Others also have their various ways - just look at the Linux VDSO
clock_gettimeimplementations for various architectures.
- x86, x86-64: HPET,
I propose something like an atomic.clock.get that returns an i64 nanosecond count, to align with the existing wait opcodes.
- Lingua principale
- WebAssembly
- Stelle
- 767
- Fork
- 54
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WebAssembly/threads
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
WebAssembly/threads#254 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
WebAssembly/threads#253 · 6 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
WebAssembly/threads#245 · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
WebAssembly/threads#240 ·
-
Branch renaming Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 20/100
WebAssembly/threads#237 ·
Tutte le issue di WebAssembly/threads
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
nextbsd/nextbsd-userland#285 ·
-
bug good first issue os compatibility
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Bug Good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
johnsonjh/emu2-cpm86#61 · 1 commento ·
-
systemd wants vs requires Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100