Closed dweiller closed 1 year ago
Now without a deadlock.
I've testing against this program with byte count up to 100 000 000 000:
pub fn main() !void { const stderr = std.io.getStdErr(); const byte_count = if (std.os.argv.len > 1) try std.fmt.parseInt(usize, std.mem.span(std.os.argv[1]), 10) else 1 << 20; const bytes = "DeadLock" ** 512; var bytes_written: usize = 0; while (bytes_written + bytes.len <= byte_count) { bytes_written += try stderr.write(bytes); } if (bytes_written < byte_count) { try stderr.writeAll(bytes[0..][0 .. byte_count - bytes_written]); } std.process.exit(1); } const std = @import("std");
Thanks for the follow-up!
Now without a deadlock.
I've testing against this program with byte count up to 100 000 000 000: