[Gambas-user] Faster compiler

Bruce Steers bsteers4 at gmail.com
Sun Jan 31 23:42:26 CET 2021


On Sun, 31 Jan 2021, 22:29 Benoît Minisini, <g4mba5 at gmail.com> wrote:

> Le 31/01/2021 à 23:14, Brian G a écrit :
> > Does This Help or is it required for a common call for all systems?
> >
> > #include <sys/sysinfo.h>
> > //raspi-os and linux
> > https://linux.die.net/man/3/get_nprocs
> > int main(int argc, char *argv[])
> > {
> >      printf("This system has %d processors configured and "
> >          "%d processors available.\n",
> >          get_nprocs_conf(), get_nprocs());
> >      return 0;
> > }
> >
> >
> /******************************************************************************/
> > // https://www.freebsd.org/cgi/man.cgi?sysctl(3)
> > // FreeBSD,OpenBsd,MacOSX Get systctl
> > //   #include <sys/types.h>
> > //   #include <sys/sysctl.h>
> > //   int mib[2], ncpus;
> > //   size_t len;
> > //
> > //   mib[0] = CTL_HW;
> > //   mib[1] = HW_NCPU;
> > //   len = sizeof(ncpus);
> > //   sysctl(mib, 2, &ncpus, &len, NULL, 0);
> > ~
> >
> > Thank You
> > Brian G
> >
>
> Yes. I knew for Linux, but didn't for BSD*. Then I can add a
> System.CpuCount property!
>

Nice 😊
and thank you Brian.
Maybe even a -j all or -j max or -j auto to use all cores automatically
could be possible too?

Wishing well
BruceS

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210131/b239ec0d/attachment.htm>


More information about the User mailing list