0.12.0-dev.1819 std.event.Channel depends on std.atomic.Queue

I’m trying the std.event.Channel to learn and see whether it has similar usage as the channel messaging in Golang. With 0.12.0-dev.1819, there is a compile error about std.atomic.Queue.

There is a change (std: remove atomic.Queue · ziglang/zig@edb2f72 · GitHub) describing the Queue removal. Does this mean the Channel is in the middle of work? and that I should wait before more experiments. Nothing urgent, just learning.

1 Like

It looks like both have been removed now. I guess we now need to manually manage a mutex on a TailQueue according to the comments on the PR?

My guess is that the nightly (0.12.0-dev) is evolving at a rapid pace (just seeing how much the builder is changing).

I remember seeing that there was a comment to the effect of poor man’s channel by using the FIFO data structure in one of the Show and Tell posted projects. That might be an approach to experiment with.

Also, when searching for event libraries there were several that give examples of channels. Some of the projects were 0.11 of Zig, but they give more ideas. I remember one library was based on the Mitchell Hashimoto event library. Which is now what seems worth investigating.