Re: FreeBSD thread priorities



Hi David,

> For some reason the pthread thread priorities don't take the POSIX_ defines
> on FreeBSD and a different set of values are used.  This patch fixes the
> thread priorities for FreeBSD.

I don't understand, what you mean here. Can you elaborate?

> Index: gthread-posix.c
> ===================================================================
> RCS file: /cvs/gnome/glib/gthread/gthread-posix.c,v
> retrieving revision 1.26
> diff -u -r1.26 gthread-posix.c
> --- gthread-posix.c 2001/02/15 16:43:02 1.26
> +++ gthread-posix.c 2001/03/19 22:46:43
> @@ -97,8 +97,18 @@
> 
>  #if defined (POSIX_MIN_PRIORITY) && defined (POSIX_MAX_PRIORITY)
>  # define HAVE_PRIORITIES 1
> -# define PRIORITY_LOW_VALUE POSIX_MIN_PRIORITY
> -# define PRIORITY_URGENT_VALUE POSIX_MAX_PRIORITY
> +# ifndef __FreeBSD__
> +#  define PRIORITY_LOW_VALUE POSIX_MIN_PRIORITY
> +#  define PRIORITY_URGENT_VALUE POSIX_MAX_PRIORITY
> +# else /* __FreeBSD__ */
> +   /* FreeBSD threads use different priority values from the
> +    * POSIX_ defines so we just set them here.
> +    */
> +#  define PRIORITY_LOW_VALUE      0
> +#  define PRIORITY_NORMAL_VALUE   15
> +#  define PRIORITY_HIGH_VALUE     19 /* garbage collector is 20 */
> +#  define PRIORITY_URGENT_VALUE   31
> +# endif /* __FreeBSD__ */
>  #endif /* POSIX_MIN_PRIORITY && POSIX_MAX_PRIORITY */

Why is 15 and 19 better than 12 and 24, as GLib would put it, or don't
POSIX_MIN_PRIORITY and POSIX_MAX_PRIORITY have the right values (0 and 31)?

Bye,
Sebastian

-- 
Sebastian Wilhelmi
mailto:wilhelmi ira uka de
http://goethe.ira.uka.de/~wilhelmi




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]