[Gambas-user] New feature in Task Class

Tobias Boege taboege at ...626...
Fri Mar 13 15:24:12 CET 2015


On Fri, 13 Mar 2015, Beno?t Minisini wrote:
> Le 13/03/2015 14:07, Yahoo a ?crit :
> > Hello Benoit,
> >
> > Do you think if it's possible to implement a way to limit a Task to
> > use only a number of cpu and better will be to choose witch cpu a
> > Task is allowed to use ?
> >
> > I know that is possible to limit at the execution of a process the
> > number and more exactly witch CPUs the process could use to run but
> > not if it is possible to do that for a process Fork.
> >
> > In my idea, I will limit the main process of my program on 1 specific
> > cpu and if I start Task to limit these Task to use specific others
> > CPUs.
> >
> >
> > Thank you in advance.
> >
> > Olivier Cruilles
> >
> 
> A task is a forked process, so if you know how to do that 
> programmatically (which API to use), just tell me.
> 

You can specify a fixed set of CPUs a thread may run on using
sched_setaffinity(2) but my manpage lists it in the "Linux Programmer's
Manual" which may indicate that it is not portable? Since every process
is a thread, this will also work with forks.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list