From: Davide Libenzi <davidel@xmail.virusscreen.com>
To: Mike Kravetz <mkravetz@sequent.com>
Cc: Andrea Arcangeli <andrea@suse.de>,
lse-tech@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [Lse-tech] Re: multi-queue scheduler update
Date: Fri, 19 Jan 2001 15:24:41 -0800 [thread overview]
Message-ID: <01011915244102.01005@ewok.dev.mycio.com> (raw)
In-Reply-To: <20010118155311.B8637@w-mikek.des.sequent.com> <01011914030601.01005@ewok.dev.mycio.com> <20010119141844.I26968@w-mikek.des.sequent.com>
In-Reply-To: <20010119141844.I26968@w-mikek.des.sequent.com>
On Friday 19 January 2001 15:23, Mike Kravetz wrote:
> On Fri, Jan 19, 2001 at 02:03:06PM -0800, Davide Libenzi wrote:
> <stuff deleted>
>
> > > void oneatwork(int thr)
> > > {
> > > int i;
> > > while (!start) /* don't disturb pthread_create() */
> > > usleep(10000);
> > >
> > > actthreads++;
> > > while (!stop)
> > > {
> > > if (count)
> > > totalwork[thr]++;
> > >
> > > syscall(158); /* sys_sched_yield() */
> > > }
> > > actthreads--;
> > > pthread_exit(0);
> > > }
> > >
> > > Note that actthreads is a global variable which is being updated
> > > by multiple threads without any form of synchronization. Because
> > > of this actthreads sometimes never goes to zero after all worker
> > > threads have finished.
> >
> > If all threads complete successfully actthreads has to be zero.
>
> Not as currently coded. If two threads try to decrement actthreads
> at the same time, there is no guarantee that it will be decremented
> twice. That is why you need to put some type of synchronization in
> place.
Right, inc & dec are not atomic w/o #LOCK.
- Davide
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2001-01-19 23:24 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-18 23:53 multi-queue scheduler update Mike Kravetz
2001-01-19 0:26 ` Andrea Arcangeli
2001-01-19 0:51 ` [Lse-tech] " Andi Kleen
2001-01-19 1:14 ` John Clemens
2001-01-19 0:52 ` [Lse-tech] " Mike Kravetz
2001-01-19 1:30 ` Andrea Arcangeli
2001-01-19 1:34 ` Mike Kravetz
2001-01-19 20:49 ` Mike Kravetz
2001-01-19 21:51 ` Mike Kravetz
2001-01-19 22:03 ` Davide Libenzi
2001-01-19 22:18 ` Mike Kravetz
2001-01-19 23:24 ` Davide Libenzi [this message]
2001-01-19 1:39 ` Davide Libenzi
2001-01-19 16:06 ` David Lang
2001-01-19 1:00 ` Mark Hahn
2001-01-19 1:08 ` Andi Kleen
2001-01-19 1:23 ` Mike Kravetz
2001-01-19 1:38 ` Davide Libenzi
2001-01-19 1:35 ` Andrea Arcangeli
2001-01-19 1:48 ` Andi Kleen
2001-01-19 23:35 ` Mike Kravetz
2001-01-19 0:43 ` Gerhard Mack
2001-01-23 16:49 ` [Lse-tech] " Jun Nakajima
[not found] ` <LYR76657-1923-2001.01.23-08.54.49--mikek#sequent.com@lyris.sequent.com>
2001-01-23 17:08 ` Mike Kravetz
2001-01-19 15:47 [Lse-tech] " Hubertus Franke
2001-01-19 17:11 ` Mike Kravetz
[not found] ` <LYR76657-5332-2001.01.19-12.12.38--mikek#sequent.com@lyris.sequent.com>
2001-01-19 20:32 ` Mike Kravetz
2001-01-19 16:30 Hubertus Franke
2001-01-19 16:33 ` nick
2001-01-19 17:06 ` Tim Wright
2001-01-19 16:47 Hubertus Franke
2001-01-19 18:03 Hubertus Franke
2001-01-19 19:52 ` bert hubert
2001-01-22 13:35 Hubertus Franke
2001-01-22 16:58 ` Davide Libenzi
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=01011915244102.01005@ewok.dev.mycio.com \
--to=davidel@xmail.virusscreen.com \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=mkravetz@sequent.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).