Rodrigo Rosenfeld Rosas wrote: > Em Quarta 03 Maio 2006 04:57, Jan Kiszka escreveu: > >>> ...Or should I use other IPC mechanism for sharing resource with >>> PIP? >> Mutexes were invented for such resource access control :). They have a >> strict ownership concept, thus allowing to apply PIP as well. > > Yes, however I can't figure out how could I use mutexes as counting > semaphores, for instance. They have different meanings. However I could think > in semaphores protected by PIP in singular cases, although I couldn't figure > out how to do it in a systematic approach so that it could be used in a > realtime framework such as Xenomai... >
So you have to protect a multi-instance resource which can be used by a certain number of tasks in parallel? Is this a real scenario or just a hypothetical? Let's consider it's real: this means that every task successfully requesting the resource becomes one of the owners. So you would have to maintain a list of owners, not just a single reference as with mutexes. Once someone requests the resource when there are no instances left, at least one of the owners should be boosted to the requesters priority. All feasible, but probably so special with traps and pitfalls (think of initialising or handling multiple requests by the same tasks) that no one yet developed a generic mechanism for any OS I know of. But you are always free to do so based on existing elementary mechanisms. :) Jan
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
