MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
[MUD-Dev] Re: Sockets and fibers
On Wed, 20 Jan 1999 10:36:44 -0800
Caliban Tiresias Darklock<caliban#darklock,com> wrote:
> From: Adam J. Thornton
>> I suppose this really turns into a request about what a fiber is.
> Per MS docs: "A fiber is a lightweight thread that is manually
> scheduled. Specific fiber APIs include: ConvertThreadToFiber()
> CreateFiber() DeleteFiber() GetCurrentFiber() GetFiberData()
> SwitchToFiber()"
From a MUD server viewpoint fibers are actually pretty obvious:
they are threads that the application itself handles the scheduling
for.
Consider the typical MOO or ColdX:
There are various verbs etc which are executing in parallel. In
order to preserve responsiveness the server itself, multi-threads
the verb executions. It does this by allocating a processer time
per verb, and then cooperatively context switching over to the next
verb in the round-robin ring. ie the server core cycles among the
verbs in an elegant and controlled manner, managing its own
deadlock/data-integrity issues etc for itself without any kernel
involvement.
<<Yes, I know that this really isn't true, but its good enough.>>
Compare this to more typical threads, such as pthreads , or threads
under OS/2 or NT.
There threads are actually almost independant processes except for
the fact that they share a data segment. Further, the threads don't
context shift cooperatively, but instead are scheduled by the kernel
and context shift preemptively. In this model threads are really
stand alone beasts that are launched in parallel with the current
execution, and then left to more or less run on their own (minus
enforced synchronise points etc). With fibers, the application
itself manages all its internal "threading", and so does __ALL__ the
dirty work.
What does NT's implementation of fibers give you above the simple
and fairly obvious cooperative task switching commonly used in MUD
servers? I have no idea. I suspect that it mostly gives you a
uniform (?) interface to the concept with some documented
behaviours.
--
J C Lawrence Internet: claw#kanga,nu
(Contractor) Internet: coder#kanga,nu
---------(*) Internet: claw#under,engr.sgi.com
...Honorary Member of Clan McFud -- Teamer's Avenging Monolith...
- Thread context:
- [MUD-Dev] Re: ADMIN: List server and Kanga.Nu host changes,
Koster, Raph rkoster#origin,ea.com, Thu 21 Jan 1999, 00:04 GMT
- [MUD-Dev] Re: [DevMUD] Re: From Devmud: Database module, draft 3,
Greg Connor gconnor#nekodojo,org, Wed 20 Jan 1999, 23:58 GMT
- [MUD-Dev] Re: Sockets and fibers,
Caliban Tiresias Darklock caliban#darklock,com, Wed 20 Jan 1999, 18:41 GMT
- [MUD-Dev] Sockets and fibers,
Caliban Tiresias Darklock caliban#darklock,com, Wed 20 Jan 1999, 17:15 GMT
[ Other Periods
| Other mailing lists
| Search
]