What is the potential issues of using fibers in node.js?

46 views Asked by At

I am planning to experiment the use of fibers in node.js? What are the potential issues that I should consider? Looks like fibers really the opposite of the nice design of simplicity of event-loop and single thread design of node.js.

1

There are 1 answers

0
hohoho On BEST ANSWER

Bad programming! Fibers put the control to the programmer's hand where they can decide where in his code to explicitly yield and gives CPU cycles to other fibers. They need to protect critical sections of his code if yield, so if he is not doing right to protect his critical sections, things may go wrong.

If another fiber is using callback that is blocking the eventloop, then we will run into starvation, but this is not specific to fibers but also happens w/o fibers.