Skip to content

Releases: floscodes/futurez

v0.2.0 – Zig 0.16 support & rename to future

28 May 10:22

Choose a tag to compare

What's Changed

Renamed: coroutinez → futurez

The project has been renamed to futurez to better reflect what it actually does: a thread-pool-based future/task runtime, not a coroutine runtime.

Zig 0.16 support

  • Migrated from std.Thread.Mutex/std.Thread.Condition to std.Io.Mutex/std.Io.Condition
  • Migrated from the managed std.ArrayList API to the new unmanaged API
  • Replaced std.time.sleep (removed in 0.16)

Bug fixes

  • initWithCores did not actually limit the thread count (passed wrong argument to initRuntime)
  • Iterator invalidation in deinit when multiple tasks were unjoined (for loop over a slice that was modified during iteration)
  • Memory leak in spawn when task_queue.append failed — allocations were not cleaned up
  • Functions returning !T (error unions) were unsafely cast; the output field now stores only the payload type
  • testfn3 hardcoded std.testing.allocator internally instead of accepting an allocator as parameter
  • Use-after-free in workerThread: t.cond.broadcast() was called after mutexUnlock, giving join() a window to free the task first — fixed by broadcasting before
    unlocking
  • Wrong import name in examples/basic.zig; const rt was const instead of var

v0.1.0

27 Jun 17:33
d0eee81

Choose a tag to compare

Breaking Changes

  • Rename package from azync to coroutinez
  • Rename datatype Future to Task
  • Rename Await method to join

Docs

  • Refactor README and improve example by @bnidev in #2