Talk:Fiber (computer science)
From Wikipedia, the free encyclopedia
[edit] Merge/refactor?
Fibers are already explained with somewhat more detail on thread (computer science). Maybe fiber (computer science) and thread (computer science) (and possibly computer multitasking) should be refactored? —Tobias Bergemann 17:29, 18 December 2006 (UTC)
- Not merge; they're different concepts with some confusion of vocabulary. (Fibers are strictly cooperatively multitasked, and so don't need to worry about thread safety etc.) Some degree of refactoring might help, I guess; what are you suggesting? --EdC 00:51, 19 December 2006 (UTC)
- Hm. I really don't know. As you wrote, there appears to be some confusion of vocabulary. I am not sure I understand the difference between fibers and coroutines, and I only ever have heard the term fiber used in the context of Microsoft Windows. So I would say: Either merge fiber (computer science) back into thread (computer science) (or perhaps coroutines), or add some references for the usage of the term fiber, or add some description of the Windows API. —Tobias Bergemann 10:29, 19 December 2006 (UTC)
- Well, I've taken the latter two options; I don't really know the Windows API all that well (though it appears fairly straightforward) but have linked into MSDN. I think the distinction is – at the level of the Windows API certainly – that coroutines are a technique, while fibers are a facility. --EdC 01:30, 24 December 2006 (UTC)
- Hm. I really don't know. As you wrote, there appears to be some confusion of vocabulary. I am not sure I understand the difference between fibers and coroutines, and I only ever have heard the term fiber used in the context of Microsoft Windows. So I would say: Either merge fiber (computer science) back into thread (computer science) (or perhaps coroutines), or add some references for the usage of the term fiber, or add some description of the Windows API. —Tobias Bergemann 10:29, 19 December 2006 (UTC)
[edit] Similar to continuation?
There is an article on Continuation. Fibers appear to be very similar to continuations. If they are the same, perhaps the articles should be merged. If they are not the same, then perhaps a reference and some distinctions should be added to the article. Kevin99 18:06, 21 February 2007 (UTC)
- Fibers can be implemented using continuations, but not the other way around. Continuations are essentially a first-class object containing the current state of a fiber - but can be invoked more than once (or not at all). Schemers frequently implement fibers this way using a few lines of code, in fact. Anaholic (talk) 10:12, 7 December 2007 (UTC)
[edit] Similar to green thread?
How do they relate to green threads? Seems to be the same to me.24.203.136.86 (talk) 18:00, 14 March 2008 (UTC)postsigned
- Green threads are a virtual machine construct; fibers are provided by the operating system and/or C library. Also, green threads try to appear as much as possible like "real" threads to the running code, while fibers have to be scheduled explicitly. EdC (talk) 13:53, 16 March 2008 (UTC)
- Thank you. If I understand correctly, threads are different because blocking calls don't affect other threads; fibers are different because you must explicitly yield; green threads are different because they are not system calls but application code (and this I have difficulties wrapping my head around as it isn't obvious where the system ends and where the application begins).
- Also, from threads: "SunOS 4.x implemented "light-weight processes" or LWPs as fibers known as green threads" seems to imply green threads are fibers. It may be I haven't dug enough. If that is the case, I'll refrain from commenting until I've had time to master those finer points.70.81.152.109 (talk) 19:52, 19 March 2008 (UTC)

