Re: [PHP-DEV] [RFC] Add num_available_processors

2025-06-17 Thread Eric Norris
Hello! On Sun, Jun 15, 2025 at 1:33 PM Daniel Kesselberg wrote: > > Hi, > > Thanks for all your feedback on the RFC. > > I've updated the RFC to incorporate most of your feedback: > https://wiki.php.net/rfc/num_available_processors > > 1) The limitation, that the CPU affinity mask is ignored > 2)

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-06-17 Thread Gina P. Banyard
On Sunday, 15 June 2025 at 19:32, Daniel Kesselberg wrote: > Hi, > > Thanks for all your feedback on the RFC. > > I've updated the RFC to incorporate most of your feedback: > https://wiki.php.net/rfc/num_available_processors > > 1) The limitation, that the CPU affinity mask is ignored This i

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-06-16 Thread Larry Garfield
On Sun, Jun 15, 2025, at 9:04 AM, Daniel Kesselberg wrote: > Hi Larry, > > Thanks for your feedback. > > I've reworked the introduction at > https://wiki.php.net/rfc/num_available_processors and hopefully the use > case is a bit clearer now. > > Best > Daniel It is, thanks. For the name, I do

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-06-16 Thread Tim Düsterhus
Hi Am 2025-06-15 19:30, schrieb Daniel Kesselberg: How do we continue? ;) I see there are various ideas how to approach it, is that something you would vote (let's do a or b) on, or how does that work? Having secondary votes is generally frowned upon for this kind of simple RFCs. It's mostly

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-06-15 Thread Daniel Kesselberg
Hi, Thanks for all your feedback on the RFC. I've updated the RFC to incorporate most of your feedback: https://wiki.php.net/rfc/num_available_processors 1) The limitation, that the CPU affinity mask is ignored 2) The naming discussion 3) Function availability on unsupported platforms 4) Retu

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-06-15 Thread Daniel Kesselberg
Hi Rob, Thanks for your feedback. I've added a note, to the proposal section, that the cpu affinity mask is currently not considered. The current patch is rather small. Taking the CPU affinity mask into account will require a more work and introduces different code paths for linux, bsd and w

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-06-15 Thread Daniel Kesselberg
Hi Larry, Thanks for your feedback. I've reworked the introduction at https://wiki.php.net/rfc/num_available_processors and hopefully the use case is a bit clearer now. Best Daniel On 2025-05-25 22:22, Larry Garfield wrote: On Sat, May 24, 2025, at 12:37 PM, Daniel Kesselberg wrote: Hi ev

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-27 Thread Ben Ramsey
On 5/24/25 15:28, Niels Dossche wrote: On 24/05/2025 21:24, Rob Landers wrote: On Sat, May 24, 2025, at 19:42, Niels Dossche wrote: Hi In my opinion, the return type should not be nullable. Returning NULL when the platform (or PHP on that platform) doesn't support getting this information i

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-27 Thread Ben Ramsey
On 5/27/25 12:01, Derick Rethans wrote: On 27 May 2025 17:37:47 BST, Ben Ramsey wrote: Are you suggesting that the function itself not be available or that it throws when you attempt to call it on a system that doesn't support it? I don't like the idea of the function not being available if

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-27 Thread Derick Rethans
On 27 May 2025 17:37:47 BST, Ben Ramsey wrote: > >Are you suggesting that the function itself not be available or that it throws >when you attempt to call it on a system that doesn't support it? > >I don't like the idea of the function not being available if the system >doesn't support the funct

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-27 Thread Côme Chilliet
Le samedi 24 mai 2025, 19:42:34 heure d’été d’Europe centrale Niels Dossche a écrit : > In my opinion, the return type should not be nullable. > Returning NULL when the platform (or PHP on that platform) doesn't support > getting this information is an anti-pattern. > Instead, availability of the

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-25 Thread Larry Garfield
On Sat, May 24, 2025, at 12:37 PM, Daniel Kesselberg wrote: > Hi everyone, > > I'm happy to share my first RFC :) It proposes adding a small function > to retrieve the number of available processors; a feature that's > commonly found in other programming languages and one that I believe > would

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-25 Thread Tim Düsterhus
Hi Am 2025-05-25 12:07, schrieb Alwin Garside: Finally, from a quick search in php-src there doesn't seem to be any existing function name that starts with `num_`. For the sake of consistency with the existing PHP functions, and similar functionality in other languages, I suggest suffixing the

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-25 Thread Rob Landers
On Sun, May 25, 2025, at 12:07, Alwin Garside wrote: > On 24 May 2025, at 20:48, Rob Landers wrote: > > > > On Sat, May 24, 2025, at 19:37, Daniel Kesselberg wrote: > >> > >> > >> Hi everyone, > >> > >> I'm happy to share my first RFC :) It proposes adding a small function > >> to retrieve th

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-25 Thread Alwin Garside
On 24 May 2025, at 20:48, Rob Landers wrote: > > On Sat, May 24, 2025, at 19:37, Daniel Kesselberg wrote: >> >> >> Hi everyone, >> >> I'm happy to share my first RFC :) It proposes adding a small function >> to retrieve the number of available processors; a feature that's >> commonly found i

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-24 Thread Rob Landers
On Sat, May 24, 2025, at 22:28, Niels Dossche wrote: > On 24/05/2025 21:24, Rob Landers wrote: > > > > > > On Sat, May 24, 2025, at 19:42, Niels Dossche wrote: > >> Hi > >> > >> In my opinion, the return type should not be nullable. > >> Returning NULL when the platform (or PHP on that platform

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-24 Thread Niels Dossche
On 24/05/2025 21:24, Rob Landers wrote: > > > On Sat, May 24, 2025, at 19:42, Niels Dossche wrote: >> Hi >> >> In my opinion, the return type should not be nullable. >> Returning NULL when the platform (or PHP on that platform) doesn't support >> getting this information is an anti-pattern. >> I

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-24 Thread Rob Landers
On Sat, May 24, 2025, at 19:42, Niels Dossche wrote: > Hi > > In my opinion, the return type should not be nullable. > Returning NULL when the platform (or PHP on that platform) doesn't support > getting this information is an anti-pattern. > Instead, availability of the necessary functionality

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-24 Thread Rob Landers
On Sat, May 24, 2025, at 19:37, Daniel Kesselberg wrote: > Hi everyone, > > I'm happy to share my first RFC :) It proposes adding a small function > to retrieve the number of available processors; a feature that's > commonly found in other programming languages and one that I believe > would be

Re: [PHP-DEV] [RFC] Add num_available_processors

2025-05-24 Thread Niels Dossche
Hi In my opinion, the return type should not be nullable. Returning NULL when the platform (or PHP on that platform) doesn't support getting this information is an anti-pattern. Instead, availability of the necessary functionality should be checked at configure time and the function should be ma

[PHP-DEV] [RFC] Add num_available_processors

2025-05-24 Thread Daniel Kesselberg
Hi everyone, I'm happy to share my first RFC :) It proposes adding a small function to retrieve the number of available processors; a feature that's commonly found in other programming languages and one that I believe would be a useful addition to PHP. The related PR has already received a b