[pso] Situatie de race la tema 1

Bogdan Harjoc harjoc at gmail.com
Fri Mar 24 20:48:33 EET 2006


On 3/24/06, Maximilian Machedon <maximilian.machedon at gmail.com> wrote:
>
>     Citez din mailul meu:
>
> "
> Nu am putut evita aceasta situatie deoarece nu am
> gasit o metoda folosibila in interiorul unei regiuni spin-lock (IRQL >=
> DISPATCH_LEVEL) sa aflu daca un pid este valabil.
> "


Probabil e ceva gresit si la "solutia" asta ... in fine:

In my_syscall(), cand primesti REQUEST_START_MONITOR:

---8<---------------------------
spinlock_acquire()
checking_pid = 1;
list_clear(exited_pids);
spinlock_release()

check_pid();

spinlock_acquire()
checking_pid = 0;
if (list_find(exited_pids, pid))
    pid_is_invalid();
...

---8<---------------------------

In rutina de tratare a exit-ului:
spinlock_acquire()
if (checking_pid)
    list_append(exited_pids, this_pid)
spinlock_release()

---8<-----------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/pso/attachments/20060324/7e843806/attachment.html


More information about the pso mailing list