diff options
author | 2022-09-22 02:25:32 -0700 | |
---|---|---|
committer | 2022-09-22 02:25:32 -0700 | |
commit | ce9daa48572a345ffd95e41d9f64b9e4719a88fa (patch) | |
tree | d3a6198f4c17e4afe3edb403efc9eea08212a589 /src/io/io_linux.zig | |
parent | e15fb6b9b220510df049e782d4f2f6eb3150d069 (diff) | |
download | bun-ce9daa48572a345ffd95e41d9f64b9e4719a88fa.tar.gz bun-ce9daa48572a345ffd95e41d9f64b9e4719a88fa.tar.zst bun-ce9daa48572a345ffd95e41d9f64b9e4719a88fa.zip |
1 event loop per thread. Instead of 3.
uWebSockets and uSockets will need to be upgraded to match the changes.
Previously:
- Bun had a separate kqueue/eventfd just for async wakeups.
- Bun had a separate kqueue/epoll just for reading files non-blocking in the same thread
This commit unifies it into one event loop per thread
Diffstat (limited to 'src/io/io_linux.zig')
-rw-r--r-- | src/io/io_linux.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/io/io_linux.zig b/src/io/io_linux.zig index d3af77d7c..00cc0c03e 100644 --- a/src/io/io_linux.zig +++ b/src/io/io_linux.zig @@ -987,9 +987,13 @@ pub const Completion = struct { pub const Waker = struct { fd: os.fd_t, - pub fn init(_: std.mem.Allocator) !Waker { + pub fn init(allocator: std.mem.Allocator) !Waker { + return try initWithFileDescriptor(allocator, try std.os.eventfd(0, 0)); + } + + pub fn initWithFileDescriptor(_: std.mem.Allocator, fd: os.fd_t) Waker { return Waker{ - .fd = try os.eventfd(0, 0), + .fd = fd, }; } |