Franky speaking, how many of us know that a concept of Fibers exists in Windows? I can’t see any raised hands 🙂
Few days back I was checking some thread synchronization stuff on MSDN, that’s when I found this strange thing (What Fiber???Which Fiber???Where Fiber???). Let me share my G.K regarding Fibers with you…
Fibers were added to Windows to make life easier for guys trying to port existing UNIX server applications to windows. Actually, UNIX server application works with a single thread but act as multi threaded apps. That is, UNIX server applications are single threaded but can serve multiple clients. Developers creating applications for UNIX have to create their own threading library in order to simulate pure threads. These developer created threading packages contains multiple stacks, persists data in CPU registers and switch among these stacks to give user an impression of multi threading.
Redesigning existing UNIX server applications for Windows can take months to complete. To help companies port their code correctly and quickly to Windows, MS added the concept of Fibers to windows.
Fibers always work in user mode and kernel knows nothing about them. They work according to algorithm that you define i.e. fiber scheduling algorithm is defined by you.
This is just a brief knowledge about Fibers. I don’t want to dig deep into it as everything that comes after this is related to windows internals, like WIN32 API calls to convert existing threads to Fibers, allocating stack memory and playing with registers.
So now, if some one asks you a silly question you can ask him to define a Fiber. It will be fun. Anyways, right now I am having some fibre rich breakfast i.e. some honey almond museli with cold milk. Have to reach office within one hour. Hurry up!!
“I am the One” – [ Neo says so in Matrix ]