| ▲ | flohofwoe 6 hours ago | |||||||
> Actually it seems like they just colored everything async and you pick whether you have worker threads or not. There is no 'async' anywhere yet in the new Zig IO system (in the sense of the compiler doing the 'state machine code transform' on async functions). AFAIK the current IO runtimes simply use traditional threads or coroutines with stack switching. Bringing code-transform-async-await back is still on the todo-list. The basic idea is that the code which calls into IO interface doesn't need to know how the IO runtime implements concurrency. I guess though that the function that's called through the `.async()` wrapper is expected to work properly both in multi- and single-threaded contexts. | ||||||||
| ▲ | jayd16 6 hours ago | parent [-] | |||||||
> There is no 'async' I meant this more as simply an analogy to the devX of other languages. >Bringing code-transform-async-await back is still on the todo-list. The article makes it seem like "the plan is set" so I do wonder what that Todo looks like. Is this simply the plan for async IO? > is expected to work properly both in multi- and single-threaded contexts. Yeah... about that.... I'm also interested in how that will be solved. RTFM? I suppose a convention could be that your public API must be thread safe and if you have a thread-unsafe pattern it must be private? Maybe something else is planned? | ||||||||
| ||||||||