janet-lang / janet

A dynamic language and bytecode vm
https://janet-lang.org
MIT License
3.38k stars 217 forks source link

cannot marshal fiber with c stackframe #1366

Closed amano-kenji closed 3 months ago

amano-kenji commented 5 months ago

I tried to pass error and fiber from try block to another thread through a threaded channel, but I got

error: cannot marshal fiber with c stackframe (<cfunction os/spawn>)
  in ev/give [src/core/ev.c] on line 971
  in <anonymous> [/path/to/j3blocks.janet] (tailcall) on line 28, column 45

Thus, I had to put a task that processes fiber errors on the thread. This is not good because I cannot serialize execution between three tasks on the same thread. I could only serialize execution between two tasks on the same thread.

iacore commented 5 months ago

can you send fiber across process?

bakpakin commented 5 months ago

There was another issue with this in an earlier issue - see https://github.com/janet-lang/janet/issues/1326