php-kmeans
php-kmeans copied to clipboard
Multithread for the win
Multithreading the algo would significantly improve the performances. We may use the pthread library when available or proc_open (if none are available well :man_shrugging: )
And it would be so much fun to code :star_struck:
Found this article about an implementation in Java (see PARALLELIZATION ANALYSIS). May be useful.
If you're considering multithreading, fibers might be an option too.
https://php.watch/versions/8.1/fibers
If you're considering multithreading, fibers might be an option too.
https://php.watch/versions/8.1/fibers
Looks amazing :star_struck:
This feature is available in php 8.1. Unfortunately, 8.1 is still in beta. According to the php team, rc2 (release candidate) will be released on "16 September 2021".
https://www.php.net/index.php#id2021-09-02-1
I believe we should implement several adapters for concurrency/multithreading.
I think we should start with pThread because it has the best portability and support at the moment.
Great. Let's go ahead with your plan!