[M3devel] defaulting to parallel backend?

Jay K jay.krell at cornell.edu
Mon Jul 4 23:17:23 CEST 2016


ok.

Presumably something like:

name it to match C++11
They call it:
unsigned std::thread::hardware_concurrency(void);

We should call it:
PROCEDURE Thread.HardwareConcurrency(): INTEGER;

OR
PROCEDURE Thread.HardwareConcurrency(): Word.T;

One could specify the following result for "unknown": <0, 0, 1

1 is nice and safe, but lossy vs. actually knowing it is 1.

One could add another function for the known-ness boolean:

PROCEDURE Thread.HardwareConcurrencyValid(): BOOLEAN;
or
PROCEDURE Thread.HardwareConcurrencyKnown(): BOOLEAN;

"Unknown" I don't believe would really stem from the underlying implementation,
there is no error path in the underlying operating systems,
but be for platforms we don't have a port for, so is less interesting
and just returning a sub-par 1 isn't so bad.


 - Jay


----------------------------------------
> Date: Mon, 4 Jul 2016 09:55:38 -0500
> From: rodney_bates at lcwb.coop
> To: m3devel at elegosoft.com
> Subject: Re: [M3devel] defaulting to parallel backend?
>
> I prefer to use one fewer than the number of processors, so I can
> web browse, read email, review code, etc. while waiting for a
> compile. The compiler can saturate them all, making any other
> stuff very slow.
>
> On 07/04/2016 03:45 AM, Jay K wrote:
>> I suggest we make parallel backend the default.
>>
>> You can turn it off with -pb 1.
>>
>> Turn it "up" with -pb <whatever>
>>
>> And the default is a thread per processor.
>> This will be kernel specific code, but we can get far with
>>
>> 1) Win32 GetSystemInfo, if applicable (e.g. C backend)
>> 2) sysconf(_SC_NPROCESSORS_ONLN)
>>
>>
>> and I'll research the various OSes (Darwin, Linux, *BSD, Solaris, and possibly AIX, HP-UX, Irix, Mingw, Cygwin).
>> ok?
>>
>> I could really use the speed boost and multi-processor machines are overwhelmingly common now (though easily avoided with VMs).
>>
>>
>> - Jay
>>
>>
>> _______________________________________________
>> M3devel mailing list
>> M3devel at elegosoft.com
>> https://m3lists.elegosoft.com/mailman/listinfo/m3devel
>>
>
> --
> Rodney Bates
> rodney.m.bates at acm.org
> _______________________________________________
> M3devel mailing list
> M3devel at elegosoft.com
> https://m3lists.elegosoft.com/mailman/listinfo/m3devel
 		 	   		  


More information about the M3devel mailing list