From: Ian Lance Taylor <iant@google.com>
To: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Cc: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com
Subject: Re: Go patch committed: Update Go library
Date: Mon, 31 Oct 2011 23:06:00 -0000 [thread overview]
Message-ID: <mcrvcr4u82z.fsf@dhcp-172-18-216-180.mtv.corp.google.com> (raw)
In-Reply-To: <yddfwie4mtj.fsf@manam.CeBiTec.Uni-Bielefeld.DE> (Rainer Orth's message of "Thu, 27 Oct 2011 14:54:16 +0200")
[-- Attachment #1: Type: text/plain, Size: 575 bytes --]
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> the only issue I've found on Solaris is the use of pthread_yield, which
> doesn't exist even on Solaris 11. The following patch checks for this,
> and falls back to thr_yield if available.
Rather than that patch, I changed the code to use sched_yield rather
than pthread_yield. I realized that libgo is already using sched_yield,
in runtime/go-sched.c. There shouldn't be any portability penalty to
also using it in yield.c.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.
Ian
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 479 bytes --]
diff -r 7135ea46b116 libgo/runtime/yield.c
--- a/libgo/runtime/yield.c Mon Oct 31 14:53:56 2011 -0700
+++ b/libgo/runtime/yield.c Mon Oct 31 14:58:19 2011 -0700
@@ -9,7 +9,7 @@
#include <stddef.h>
#include <sys/types.h>
#include <sys/time.h>
-#include <pthread.h>
+#include <sched.h>
#include <unistd.h>
#ifdef HAVE_SYS_SELECT_H
@@ -38,7 +38,7 @@
void
runtime_osyield (void)
{
- pthread_yield ();
+ sched_yield ();
}
/* Sleep for some number of microseconds. */
next prev parent reply other threads:[~2011-10-31 22:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-27 3:07 Ian Lance Taylor
2011-10-27 14:46 ` Rainer Orth
2011-10-27 17:36 ` Ian Lance Taylor
2011-10-27 17:50 ` Rainer Orth
2011-10-31 23:06 ` Ian Lance Taylor [this message]
2011-10-31 17:57 ` Rainer Orth
2011-11-01 4:55 ` Ian Lance Taylor
2011-11-01 5:21 ` Ian Lance Taylor
[not found] ` <4EB15B7E.4050006@ubuntu.com>
2011-11-02 16:21 ` Ian Lance Taylor
2011-11-02 17:11 ` Rainer Orth
2011-11-02 18:01 ` Ian Lance Taylor
2011-11-02 18:04 ` David Daney
2011-11-02 18:23 ` Ian Lance Taylor
2011-11-02 20:23 ` Joseph S. Myers
2011-11-02 20:24 ` Joseph S. Myers
2011-11-02 18:17 ` Rainer Orth
2011-10-27 17:24 Uros Bizjak
2011-11-01 9:57 ` Uros Bizjak
2011-11-30 4:05 Ian Lance Taylor
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=mcrvcr4u82z.fsf@dhcp-172-18-216-180.mtv.corp.google.com \
--to=iant@google.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gofrontend-dev@googlegroups.com \
--cc=ro@CeBiTec.Uni-Bielefeld.DE \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).