Skip to content

Instantly share code, notes, and snippets.

@ultimagriever
Created June 9, 2020 17:36
Show Gist options
  • Save ultimagriever/15a4f4fe289b95a33ebe4ab76f65747b to your computer and use it in GitHub Desktop.
Save ultimagriever/15a4f4fe289b95a33ebe4ab76f65747b to your computer and use it in GitHub Desktop.
function conectar() {
// aqui vai toda a rotina de connect...
mysql_connect(....);
}
require 'conectar.php'
class ConectarThread extends Thread {
public function run() {
// fazer a conexão aqui
conectar();
}
}
$conexoes = [];
for ($i = 0; $i < 4096; $i++) {
$conexoes[$i] = new ConectarThread($i);
$conexoes[$i]->start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment