improvements for async-io

This commit is contained in:
Chris Boesch
2026-04-06 19:30:56 +02:00
parent aeeb18931d
commit 09bae6a70e
3 changed files with 37 additions and 25 deletions

View File

@@ -1,11 +1,11 @@
--- exercises/093_async9.zig 2026-04-03 13:44:50.526780809 +0200
+++ answers/093_async9.zig 2026-04-03 13:44:54.957870294 +0200
@@ -36,7 +36,7 @@
// Launch with a guaranteed separate thread.
// Which Io method guarantees true concurrency?
--- exercises/093_async9.zig 2026-04-06 19:26:11.388025362 +0200
+++ answers/093_async9.zig 2026-04-06 19:18:36.242931688 +0200
@@ -43,7 +43,7 @@
// Launch with a guaranteed separate unit of concurrency.
// Which Io method guarantees this?
// (Hint: unlike io.async, this one can fail!)
- var future = try io.???(compute, .{io});
+ var future = try io.concurrent(compute, .{io});
defer _ = future.cancel(io);
print("Main thread continues...\n", .{});
// Note: All breaks in this excercise (using sleep)