From: John Kacur <jkacur@redhat.com>
To: Clark Williams <williams@redhat.com>
Cc: John Kacur <jkacur@redhat.com>,
rt-users <linux-rt-users@vger.kernel.org>
Subject: [PATCH 2/3] pi_stress: Fix trailing-whitespace warnings.
Date: Mon, 16 Nov 2009 21:17:42 +0100 [thread overview]
Message-ID: <1258402663-13621-3-git-send-email-jkacur@redhat.com> (raw)
In-Reply-To: <1258402663-13621-2-git-send-email-jkacur@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/pi_tests/pi_stress.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
index 865e3b4..d90d4a9 100644
--- a/src/pi_tests/pi_stress.c
+++ b/src/pi_tests/pi_stress.c
@@ -1,8 +1,8 @@
/*
pi_stress - Priority Inheritance stress test
-
+
Copyright (C) 2006, 2007 Clark Williams <williams@redhat.com>
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@@ -19,25 +19,25 @@
USA */
/* This program stress tests pthreads priority inheritance mutexes
-
+
The logic is built upon the state machine that performs the "classic_pi"
deadlock scenario. A state machine or "inversion group" is a group of three
threads as described below.
The basic premise here is to set up a deadlock scenario and confirm that PI
mutexes resolve the situation. Three worker threads will be created from the
- main thread: low, medium and high priority threads that use SCHED_FIFO as
+ main thread: low, medium and high priority threads that use SCHED_FIFO as
their scheduling policy. The low priority thread claims a mutex and then
- starts "working". The medium priority thread starts and preempts the low
+ starts "working". The medium priority thread starts and preempts the low
priority thread. Then the high priority thread runs and attempts to claim
- the mutex owned by the low priority thread. Without priority inheritance,
- this will deadlock the program. With priority inheritance, the low priority
+ the mutex owned by the low priority thread. Without priority inheritance,
+ this will deadlock the program. With priority inheritance, the low priority
thread receives a priority boost, finishes it's "work" and releases the mutex,
which allows the high priority thread to run and finish and then the medium
- priority thread finishes.
+ priority thread finishes.
+
+ That's the theory, anyway...
- That's the theory, anyway...
-
CW - 2006 */
#include <stdio.h>
@@ -99,7 +99,7 @@ time_t start, finish;
// the number of groups to create
int ngroups = 0;
-// the number of times a group causes a priority inversion situation
+// the number of times a group causes a priority inversion situation
// default to infinite
int inversions = -1;
@@ -705,7 +705,7 @@ void *low_priority(void *arg)
debug("low_priority[%d]: unlocking mutex\n", p->id);
pthread_mutex_unlock(&p->mutex);
- // finish state
+ // finish state
debug("low_priority[%d]: entering finish wait\n", p->id);
status = pthread_barrier_wait(&p->finish_barrier);
if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) {
--
1.6.2.5
next prev parent reply other threads:[~2009-11-16 20:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-16 20:17 [PATCH 0/3] pi_stress: clean-ups John Kacur
2009-11-16 20:17 ` [PATCH 1/3] pi_stress: Fix indentation problems with Lindent from the kernel John Kacur
2009-11-16 20:17 ` John Kacur [this message]
2009-11-16 20:17 ` [PATCH 3/3] pi_stress: Convert c-plus style comments to c-style comments John Kacur
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=1258402663-13621-3-git-send-email-jkacur@redhat.com \
--to=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=williams@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).