Hello:
I understand that MUTEX is abbreviation of 'mutual exclusion', a technique used to guarantee that never two process access to a 'shared object' at the same time.
Some devices are used concurrently (by many process at the same time) and then a 'semaphore' object is needed to control the access to those devices.
My quiestion is:
This 'semaphore' must be placed into the 'device driver', or at kernel level?
I know it could be as I want, but where it is normally placed?
Thank you very much!
pepito
Device manager
RE:Device manager
Personally I would put the mutex wrap as close as possible to the critical section because what would be the point of protecting code and data that does not need protection from concurrent access. So I would first determine where and what the critical section is and then wrap it with a mutex... where you have a critical section depends totally upon your architecture. You have a critical section everywhere you have shared data that must not be accessed more than two threads/processes at the same time (this issue is nonetheless a little more complicated because you could allow more than one reader access the shared object at the same time). There might be much of those both in the driver and in the kernel.
I don't know if there is a normal place for it. I suspect that it is highly system architecture dependant.
- Esa
I don't know if there is a normal place for it. I suspect that it is highly system architecture dependant.
- Esa
RE:Device manager
Thank you very much your soon response...
I believe you are right, I´ll place the semaphores into the device drivers.
pepito
I believe you are right, I´ll place the semaphores into the device drivers.
pepito