aboutsummaryrefslogtreecommitdiff
path: root/lib/std/event/loop.zig
AgeCommit message (Collapse)Author
2020-10-12Rename .macosx to .macosVignesh Rajagopalan
2020-10-11Add more comments & cleanup AutoResetEventkprotty
2020-10-11fix DelayQueue typoskprotty
2020-10-11integrate std.time.sleep with the event loopkprotty
2020-10-11add minimal openbsd supportSébastien Marie
2020-10-07add WaitGroup to std.eventLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-10-05Revert "revert adding std.event.Loop.runDetached"Andrew Kelley
This reverts commit 70f37679035e64bacfc4807709da37bc02fbb346. After discussion, I can see the value provided here, specifically with avoiding the footgun of defer { suspend { free(@frame()); } }. However the doc comments are updated to explain the semantics directly, rather than basing them on the behavior of another programming language.
2020-10-03revert adding std.event.Loop.runDetachedAndrew Kelley
I'd like to discuss this before adding it. I think this is the wrong direction to go with this API.
2020-10-01std.event.Loop.runDetached should be pubAlexandros Naskos
2020-09-29add runDetached to event loopLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-25Merge pull request #6412 from kristoff-it/generalize-event-loopAndrew Kelley
Make os.zig not depend on the event loop
2020-09-24I think this test is still flakeyAndrew Kelley
re-opens #4922
2020-09-24recvfromLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24sendtoLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24pwritevLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24pwriteLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24writevLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24writeLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24preadvLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24preadLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24readvLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24readLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24connectLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24acceptLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-23Eventloop: Enable basic event loop test, fixed by previous commitTimon Kruiper
Closes #4922
2020-09-23Eventloop: Fix deadlock in linux event loop implementationTimon Kruiper
A simple empty main with evented-io would not quit, because some threads were still waiting to be resumed (by the os). The os.write to the eventfd only wakes up one thread and thus there are multiple writes needed to wake up all the other threads.
2020-09-10std: add option to use single-threaded event loopIsaac Freund
std.event.Loop does not yet work in single threaded builds. However, using evented io on a single thread can be very convenient. This commit allows settind @import("root").event_loop_mode to .single_threaded in order to allow this without reimplementing the startup code in start.zig
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-05-24(breaking) std.time fixups and API changesAndrew Kelley
Remove the constants that assume a base unit in favor of explicit x_per_y constants. nanosecond calendar timestamps now use i128 for the type. This affects fs.File.Stat, std.time.nanoTimestamp, and fs.File.updateTimes. calendar timestamps are now signed, because the value can be less than the epoch (the user can set their computer time to whatever they wish). implement std.os.clock_gettime for Windows when clock id is CLOCK_CALENDAR.
2020-05-07fix oneshot flag erroneusly set as filter_flagLoris Cro
2020-05-07fix crash in single-threaded buildsLoris Cro
2020-05-07Merge pull request #5268 from tadeokondrak/remove-callconv-redundant-syntaxAndrew Kelley
Remove syntax redundant with callconv
2020-05-06Standard library: Fix a regression in loop.waitUntilFdWritableOrReadableTimon Kruiper
This broke async io on linux. Regressed in 8ebcca6734e07aea29098ca4c63c0216b3099d0e
2020-05-05zig fmtTadeo Kondrak
2020-05-05zig fmtTadeo Kondrak
2020-05-02Merge remote-tracking branch 'origin/master' into FireFox317-windows-evented-ioAndrew Kelley
2020-05-02Get evented io code paths to build on macOS (#5233)Chris Heyes
* Get evented io code paths to build on macOS * Use mode_t instead of usize where appropriate
2020-05-02std.event.Loop: promote the fs thread to be available for all OS'sAndrew Kelley
2020-04-29Fix std.event.Loop.readvTadeo Kondrak
2020-04-12disable flaky event loop testAndrew Kelley
See #4922
2020-03-30std lib API deprecations for the upcoming 0.6.0 releaseAndrew Kelley
See #3811
2020-03-07add std.event.Loop pread and faccessatAndrew Kelley
progress towards std lib tests passing with evented I/O mode
2020-03-03breaking: std.os read/write functions + sendfileAndrew Kelley
* rework os.sendfile and add macosx support, and a fallback implementation for any OS. * fix sendto compile error * std.os write functions support partial writes. closes #3443. * std.os pread / pwrite functions can now return `error.Unseekable`. * std.fs.File read/write functions now have readAll/writeAll variants which loop to complete operations even when partial reads/writes happen. * Audit std.os read/write functions with respect to Linux returning EINVAL for lengths greater than 0x7fff0000. * std.os read/write shim functions do not unnecessarily loop. Since partial reads/writes are part of the API, the caller will be forced to loop anyway, and so that would just be code bloat. * Improve doc comments * Add a non-trivial test for std.os.sendfile * Fix std.os.pread on 32 bit Linux * Add missing SYS_sendfile bit on aarch64
2020-02-28introduce operating system version ranges as part of the targetAndrew Kelley
* re-introduce `std.build.Target` which is distinct from `std.Target`. `std.build.Target` wraps `std.Target` so that it can be annotated as "the native target" or an explicitly specified target. * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a struct which has the tag as well as version range information. * `std.elf` gains some more ELF header constants. * `std.Target.parse` gains the ability to parse operating system version ranges as well as glibc version. * Added `std.Target.isGnuLibC()`. * self-hosted dynamic linker detection and glibc version detection. This also adds the improved logic using `/usr/bin/env` rather than invoking the system C compiler to find the dynamic linker when zig is statically linked. Related: #2084 Note: this `/usr/bin/env` code is work-in-progress. * `-target-glibc` CLI option is removed in favor of the new `-target` syntax. Example: `-target x86_64-linux-gnu.2.27` closes #1907
2020-02-21remove the allocator from std.event.LoopAndrew Kelley
closes #3539
2020-02-08std lib typo fixupsAndrew Kelley
2020-02-06more std lib async I/O integrationAndrew Kelley
* `zig test` gainst `--test-evented-io` parameter and gains the ability to seamlessly run async tests. * `std.ChildProcess` opens its child process pipe with O_NONBLOCK when using evented I/O * `std.io.getStdErr()` gives a File that is blocking even in evented I/O mode. * Delete `std.event.fs`. The functionality is now merged into `std.fs` and async file system access (using a dedicated thread) is automatically handled. * `std.fs.File` can be configured to specify whether its handle is expected to block, and whether that is OK to block even when in async I/O mode. This makes async I/O work correctly for e.g. the file system as well as network. * `std.fs.File` has some deprecated functions removed. * Missing readv,writev,pread,pwrite,preadv,pwritev functions are added to `std.os` and `std.fs.File`. They are all integrated with async I/O. * `std.fs.Watch` is still bit rotted and needs to be audited in light of the new async/await syntax. * `std.io.OutStream` integrates with async I/O * linked list nodes in the std lib have default `null` values for `prev` and `next`. * Windows async I/O integration is enabled for reading/writing file handles. * Added `std.os.mode_t`. Integer sizes need to be audited. * Fixed #4403 which was causing compiler to crash. This is working towards: ./zig test ../test/stage1/behavior.zig --test-evented-io Which does not successfully build yet. I'd like to enable behavioral tests and std lib tests with --test-evented-io in the test matrix in the future, to prevent regressions.
2019-12-10Replace @typeOf with @TypeOf in all zig sourceRobin Voetter
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
2019-12-02bring your own OS layer in the std libAndrew Kelley
closes #3784
2019-11-27remove type coercion from array values to referencesAndrew Kelley
* Implements #3768. This is a sweeping breaking change that requires many (trivial) edits to Zig source code. Array values no longer coerced to slices; however one may use `&` to obtain a reference to an array value, which may then be coerced to a slice. * Adds `IrInstruction::dump`, for debugging purposes. It's useful to call to inspect the instruction when debugging Zig IR. * Fixes bugs with result location semantics. See the new behavior test cases, and compile error test cases. * Fixes bugs with `@typeInfo` not properly resolving const values. * Behavior tests are passing but std lib tests are not yet. There is more work to do before merging this branch.