Hi everyone,
In my project i am having different data structures
which should have access only for some classes and the structures i
had declared globally, but then i need a restricted access so thought
of using shared memory. The whole project is executed as a single
process and shared memory should be accessed between different
threads. The synchronization i need to provide obviously through
mutexes. So my questions are--
1. Is the idea better to implement shared memory rather than
declaring data structures global?
2. I need to even use signals for transferring the control, is it
feasible?
3. If a thread locked by a mutex and executing a critical section,
and if time-slice for that particular light-
weight process completes at that very
moment, will the thread hold the mutex or according to the time-slice
the OS skips the thread and executes other thread?
4. In any case a "struct sched_param param.sched_priority" need to
be set for particular threads, based on priority or can we manage
synchronization with mutexes itself?
Kindly
answer my querries..
Thanx in advance......
Bobby.
|