From: Makarand Pradhan <makarandpradhan@ruggedcom.com>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Mutex enhancement for Auto relaxed threads
Date: Thu, 22 Nov 2012 14:24:27 -0500 [thread overview]
Message-ID: <50AE7BEB.5090903@ruggedcom.com> (raw)
In-Reply-To: <50AE570E.10003@ruggedcom.com>
> Will quickly test this and get back.
Yes. That's pretty much how the system behaves.
Rgds,
Makarand.
Test program attached:
Results:
task1: Prio 0 Auto relaxed
task2: Prio 10. RT.
root@ruggedcom:~# ./tc5 0 10 1
Format: tc5 prio1 prio2 mux_iterations.
Spawning: task1
task2: Mutexes created
task2: Mutexes in memory
Running task1: status: b00380
task1: Global test: 25
task1: Acquiring mux1
rt_mutex_acquire_inner: Did system call. lockcnt: 1, dsof: 1
task1: Acquired mux1. rc: 0
task1: status: b00180
task1: Acquiring mux2
task1: Acquired mux2. rc: 0
task1: status: b00180
task1: Releasing mux1
rt_mutex_release: Doing system call. lockcnt: 0, dsof: 1
task1: Released mux1. rc: 0
task1: status: b00380 <- Relaxed task1 while holding mutex 2.
task1: bprio: 0 cprio: 0 status: b00380 info.status: b00380
task2: Acquiring mux2.
task1: bprio: 0 cprio: 10 status: b01180 info.status: b01180 <- task1
jumps to primary again..
task1: Releasing mux2
rt_mutex_release: Doing system call. lockcnt: 0, dsof: 1
rt_mutex_acquire_inner: Did system call. lockcnt: 1, dsof: 1
task2: Acquired mux2.
task2: Releasing mux2
rt_mutex_release: Doing system call. lockcnt: 0, dsof: 1
task2: Released mux2. rc: 0
task2: status: 300180
task1: Released mux2. rc: 0
task1: status: b00380
On 22/11/12 11:47 AM, Makarand Pradhan wrote:
> Hi Gilles,
>
> lock mutex1
> lock mutex2
> unlock mutex1
> unlock mutex2
>
> As per my current implementation, I expect the thread to relax after
> unlocking mutex1. If another RT thread starts waiting on mutex2, I
> expect the thread holding the mutex will harden and start running in
> primary again. Will quickly test this and get back.
>
> I did consider this scenario but since we never use such a behaviour in
> our system, did not pursue it further.
>
> This brings up another question that I was contemplating. Do we want to
> harden unless there is another RT thread wanting this mutex? If not then
> the implementation becomes simpler and the scenario mentioned would also
> get addressed automatically.
>
> Rgds,
> Mak.
>
>
>> I did not look in details at your code, but what if I do
>>
>> lock mutex1
>> lock mutex2
>> unlock mutex1
>> unlock mutex2
>>
>> ?
>>
>
--
___________________________________________________________________________
NOTICE OF CONFIDENTIALITY:
This e-mail and any attachments may contain confidential and privileged information. If you are
not the intended recipient, please notify the sender immediately by return e-mail and delete this
e-mail and any copies. Any dissemination or use of this information by a person other than the
intended recipient is unauthorized and may be illegal.
_____________________________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tc5.c
Type: text/x-csrc
Size: 4314 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20121122/9631fb18/attachment.c>
next prev parent reply other threads:[~2012-11-22 19:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-22 15:51 [Xenomai] Mutex enhancement for Auto relaxed threads Makarand Pradhan
2012-11-22 16:15 ` Gilles Chanteperdrix
2012-11-22 16:47 ` Makarand Pradhan
2012-11-22 19:24 ` Makarand Pradhan [this message]
2012-11-22 19:41 ` Makarand Pradhan
2012-11-22 16:55 ` Michael Pustylnik
2012-11-23 11:15 ` Jan Kiszka
2012-11-27 13:46 ` Gilles Chanteperdrix
2012-11-27 13:47 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50AE7BEB.5090903@ruggedcom.com \
--to=makarandpradhan@ruggedcom.com \
--cc=gilles.chanteperdrix@xenomai.org \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.