From: Kevin Hendricks <khendricks@ivey.uwo.ca>
To: linuxppc-dev@lists.linuxppc.org
Subject: How to keep gcc haifa from moving userlevel thread lock function?
Date: Tue, 1 Feb 2000 22:26:18 -0500 [thread overview]
Message-ID: <00020122402100.07553@localhost.localdomain> (raw)
Hi,
The green_threads implementation of the JDK sets a schedule lock that prevents
any green thread (not a linuxthread) from yielding (think of green_threads
as userland cooperative threads that run in a single process).
Here is the routine:
/*
* Lock the thread scheduler
*/
void
_sched_lock()
{
++_scheduling_lock;
}
where _scheduling_lock is a global integer.
The problem is that the calls to _sched_lock seems to be moved by the haifa
scheduler just enough to force me to compile many things with -O0 to prevent
problems.
I *think* gcc is inlining the call and then the haifa scheduler seems to want
to move this around abit since it does not directly impact the code around it.
What is the correct way to keep the gcc (haifa) from moving this around?
I have already tried:
"-O2 -fno-schedule-insns -fno-schedule-insns2"
but that does not seem to do the trick.
I am sure there must be some indicator (like volatile) that I should be using.
Any help would be greatly appreciated.
Thanks,
Kevin
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next reply other threads:[~2000-02-02 3:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-02 3:26 Kevin Hendricks [this message]
2000-02-02 3:57 ` How to keep gcc haifa from moving userlevel thread lock function? David Edelsohn
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=00020122402100.07553@localhost.localdomain \
--to=khendricks@ivey.uwo.ca \
--cc=linuxppc-dev@lists.linuxppc.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 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).