> But if the Fiber is blocked, it can't yield. In the comments of the > same article oldmoe states Fibers are not pre-emptive. > > So green-threads without a scheduler and manual flow-control? Meh.
Fibers (Coroutines) have to yield manually, even though this might sound like a bad thing, it has the following benefits: 1 - No thread scheduling overhead (context switching is only done on demand) 2 - No race conditions 3 - It can be abstracted away in the IO libraries, you never need to call Fiber.yield manually when you are using NeverBlock This model has been used successfully before for abstracting nonblocking evented IO, examples are Lua's nonblocking IO libraries and C Protothreads (not sure why they are called threads!) oldmoe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
