Re: Questions regarding Synchronisation in Windows (Spinlocks)
- From: smawsk <sk.smawsk@xxxxxxxxx>
- Date: Wed, 12 Mar 2008 01:23:05 -0700 (PDT)
On Mar 10, 8:02 pm, "Alexander Grigoriev" <al...@xxxxxxxxxxxxx> wrote:
1) spinlocks used to have different implementation in uniprocessor kernel.
Vista/Longhorn now only ship multiprocessor kernel.
Interrupts are handled in context of ISR. There is no thread switch, as they
don't run in a particular thread context.
"smawsk" <sk.sma...@xxxxxxxxx> wrote in message
news:b2a63809-b597-4a8c-a8f4-efc069b3a05b@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I have some questions regarding the implementation of synchronisatio
techniques in Windows.
I would be greatful if some one can answer these.
1) How are Spinlocks implemented in Windows for a UNIPROCESSOR
machine? Do they involve busy waiting?
Since Spinlocks execute at DPC/Dispatch level, there is no way for the
thread to move to wait state.
Consider a scenario where a thread is trying to acquire a spin lock.
But an interrupt occurs which has an IRQL > DPC Dispatch level OR the
IRQL of the thread that acquired the spin lock. For the new interrupt
to be serviced, dispatcher has to be invoked to switch to the new
thread servicing the interrupt.
What happens in this scenario?
2) What is the difference between an executive object and a kernel
object? Can some one give an example for each?
I reckon Semaphore, Event, Mutex etc are executive objects. So what
kernel objects are these executive objects built on?
Which category do "Dispatcher" objects belong to?
3) What is th edifference between a Mutex and Fast Mutex/Guarded
Mutex?
Thanks in advance.
Warm Regards.
Hi,
Thanks for you reply.
But when hardware generates an interrupt, whatever code that was being
executed should be stopped. The executing context should be saved
before the control is handed over to the ISR.
How different is this from a thread switch where in the context of the
currently running thread is saved and code is executed in the context
of a different thread?
I am trying to get my basics right.
Regarding other questions, I did some more research and found this.
Could you please let me know if my understanding is correct?
The difference between a Normal Mutex and a fast mutex is that, a fast
mutex does not maintain thread ownership as a normal mutex does.
For each executive object (dispatcher) there is a corresponding kernel
object on which its built.
For instance, Semaphore uses a data structure implemented by the
kernel called KSEMAPHORE.
Thanks in advance.
Warm Regards.
.
- References:
- Questions regarding Synchronisation in Windows (Spinlocks)
- From: smawsk
- Re: Questions regarding Synchronisation in Windows (Spinlocks)
- From: Alexander Grigoriev
- Questions regarding Synchronisation in Windows (Spinlocks)
- Prev by Date: Re: How does Taskman know a process is 32 or 64 bit?
- Next by Date: Re: RAM serial number and vendor
- Previous by thread: Re: Questions regarding Synchronisation in Windows (Spinlocks)
- Next by thread: STARTUPINFO abuse and WOW64 interactions with STARTUPINFO
- Index(es):
Relevant Pages
|