[ciao-users] Question Events using ACE Framework, synchronization using mutexes]

tsoumplekas_giorgos getsoubl at gmail.com
Thu May 12 02:23:28 CDT 2016


HOST MACHINE and OPERATING SYSTEM:

      Linux kernel 3.12.19,  Powerpc - QoIrq processor





SYNOPSIS:

[Events using ACE Framework, synchronization using mutexes]



DESCRIPTION:

I have a question regarding synchronization using mutex in ACE framework.
Task A has been registered with a Timer Handler.

In Task A function foo is called.

A Critical Section in foo is protected using recursive mutexes.

The variables that are used by foo function ,are used (write/read) acces by
handle_timeout.

That means that we need to protect them.



We have the following piece of pseudocode



foo()

{

lock(recursive_mutex)

C.S

unlock(recursive_mutex)

}

handle_timeout()

{

lock(recursive_mutex)

C.S

unlock(recursive_mutex)

}

If the handle_timeout takes place before foo release the lock, will a
deadlock take place?



If another event with highest priority comes what happens?. Will we have a
context switch and the second event start processing?



How we protect event to not interrupt before complete their work?

Thanks
George

Software Engineer @ Unify S.A
M.Sc. Degree in Computer Systems Technology, Kapodistrian & National
University of Athens
5-year Diploma in Computer Engineering, University of Thessaly
email: getsoubl at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.isis.vanderbilt.edu/pipermail/ciao-users/attachments/20160512/6acdb9e7/attachment.html>


More information about the ciao-users mailing list