Are you sure you want it to have RT priority? By your description I would
say you are looking for 'nice'

On Sep 3, 2010 10:40 AM, "Enlightenment SVN" <[email protected]>
wrote:
> Log:
> * ecore: ecore_thread are not here to bring your computer down, so
> reduce their priority too.
>
> Author: cedric
> Date: 2010-09-03 06:39:53 -0700 (Fri, 03 Sep 2010)
> New Revision: 51862
>
> Modified:
> trunk/ecore/src/lib/ecore/ecore_thread.c
>
> Modified: trunk/ecore/src/lib/ecore/ecore_thread.c
> ===================================================================
> --- trunk/ecore/src/lib/ecore/ecore_thread.c 2010-09-03 13:38:49 UTC (rev
51861)
> +++ trunk/ecore/src/lib/ecore/ecore_thread.c 2010-09-03 13:39:53 UTC (rev
51862)
> @@ -441,8 +441,18 @@
> if (!pth->p) goto on_error;
>
> if (pthread_create(&pth->thread, NULL, (void *) _ecore_thread_worker, pth)
== 0)
> - return (Ecore_Thread *) work;
> + {
> + /* lower priority of worker threads so they use up "bg cpu"
> + * as it was really intended to work */
> + struct sched_param param;
>
> + memset(&param, 0, sizeof(param));
> + param.sched_priority = sched_get_priority_min(SCHED_RR);
> + pthread_setschedparam(pth->thread, SCHED_RR, &param);
> +
> + return (Ecore_Thread *) work;
> + }
> +
> on_error:
> if (pth)
> {
> @@ -607,7 +617,17 @@
> pthread_t t;
>
> if (pthread_create(&t, NULL, (void *) _ecore_direct_worker, worker) == 0)
> - return (Ecore_Thread *) worker;
> + {
> + /* lower priority of worker threads so they use up "bg cpu"
> + * as it was really intended to work */
> + struct sched_param param;
> +
> + memset(&param, 0, sizeof(param));
> + param.sched_priority = sched_get_priority_min(SCHED_RR);
> + pthread_setschedparam(t, SCHED_RR, &param);
> +
> + return (Ecore_Thread *) worker;
> + }
> }
>
> pthread_mutex_lock(&_ecore_pending_job_threads_mutex);
> @@ -629,8 +649,18 @@
> if (pth->p) goto on_error;
>
> if (pthread_create(&pth->thread, NULL, (void *) _ecore_thread_worker, pth)
== 0)
> - return (Ecore_Thread *) worker;
> + {
> + /* lower priority of worker threads so they use up "bg cpu"
> + * as it was really intended to work */
> + struct sched_param param;
>
> + memset(&param, 0, sizeof(param));
> + param.sched_priority = sched_get_priority_min(SCHED_RR);
> + pthread_setschedparam(pth->thread, SCHED_RR, &param);
> +
> + return (Ecore_Thread *) worker;
> + }
> +
> on_error:
> if (pth)
> {
>
>
>
------------------------------------------------------------------------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to