Patch for 2.12 utilize sched_yield instead of sleep in event_loop attached for comments

Thomas Guyot-Sionnest dermoth at aei.ca
Wed Apr 29 08:14:54 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 28/04/09 04:37 PM, eponymous alias wrote:
> It seems unlikely that you would want to
> #include <sched.h>
> unconditionally and then only conditionally
> invoke sched_yield().
> 
> If you are going to conditionally invoke
> sched_yield(), then it ought to be done for
> the __sun__ platform as well.  And for that
> matter, the appropriate preprocessor symbols
> for non-GCC compilers ought to be checked
> as well.  Probably better overall is to
> depend instead on some global flag of your
> own which is not platform-specific, much like
> the ./configure --enable-event-broker option
> generates the USE_EVENT_BROKER flag.
>

Hi,

I'm not sure if you guys seen my post in the other related thread; why
not use _POSIX_PRIORITY_SCHEDULING?

Regarding the include of <sched.h>, if you believe it could be missing
it could be detected by autoconf with the AC_CHECK_HEADER macro (the
sched_yield block would therefore be conditional of both
_POSIX_PRIORITY_SCHEDULING and HAVE_SCHED_H).


- From my original post:
>
> I looked at the sched_yield() man page and found the following
> statement:
>
> POSIX systems on which sched_yield() is available define
> _POSIX_PRIORITY_SCHEDULING in <unistd.h>.
>
> That would make is work on more systems. My Solaris 10 server has it.
>

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJ9/Be6dZ+Kt5BchYRAvRnAJ9AmjQUL/DR2EIm1ed379yagz+mlQCgu/iU
sAOieOxUbJq+GhPqPHWZZL4=
=+yEC
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf




More information about the Developers mailing list