Re: Usage Scenarios for Fibers instead Threads,...

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello Jochen!

Yes. But fibers are running inside the same process, so no need to
switch these descriptiors ;)

That is clear.

What is the reason for Windows to not perform such an User-Mode
"Context-Switch" when scheduling another Thread from the same process on the
same CPU? So that a User-Mode Thread-Switching is automaticly performed when
possible?

Of cause this would not be an option for any kind of waiting function, which
performs an User/Kernel Mode Transistion anyway. But what if the quantum
excides? Couldn't Windows switch to another thread (of the same process)
just in User-Mode? One problem I can think of is that no one can interrupt
the Thread (when the quantum excides), because the Thread doesn't call any
function (like SwitchToFiber) where the quantum could be checked. And the
OS-Scheduler which can interrupt the Code because of the higher IRL would
need to run in Kernel-Mode too.

What about syncronization in Fibers? If I understand it correctly, one
should not use Wait-Objects like Events, because no other Fiber would be
scheduled (the OS will schedule another Thread instead). Am I right when I
claim that by using Fibers you have to use an completly different
syncronization mechanism than by using Threads? So when some want to develop
something like SQL-Servers "Enable Fibers", the whole threading /
syncronization thing has to be abstracted?



GP


.



Relevant Pages

  • Re: [PATCH 0/7] KVM: Kernel-based Virtual Machine
    ... ioctlto see which guest memory pages have changed ... encapsulated as Linux processes? ... scheduling between Xen and domain 0, use just the Linux memory management and scheduler ... better performance since there's no need to switch to domain 0 for I/O ...
    (Linux-Kernel)
  • Re: Threads vs Forks in embedded environment : Some Conclusions
    ... because there's no need to switch address spaces. ... the scheduling overheads of threads are the same as of ... because Linux threads are scheduled as if they were separate ... the Linux scheduling system will likely endure as much ...
    (comp.os.linux.development.system)
  • Re: Very good news from AMD
    ... per node, and always switch from thread to thread, every cycle, ... It switched to the next *ready* stream. ... My old micro-benchmarks made the scheduling look a bit more ...
    (comp.arch)
  • Re: Ending of todays House
    ... "next on five" crap that the other channels have? ... Don't know but I missed the whole bloody thing due to the scheduling ... switch. ...
    (uk.media.tv.misc)