Skip to content

Instantly share code, notes, and snippets.

@ultimagriever
Created June 9, 2020 17:36
Show Gist options
  • Select an option

  • Save ultimagriever/15a4f4fe289b95a33ebe4ab76f65747b to your computer and use it in GitHub Desktop.

Select an option

Save ultimagriever/15a4f4fe289b95a33ebe4ab76f65747b to your computer and use it in GitHub Desktop.

Revisions

  1. ultimagriever created this gist Jun 9, 2020.
    5 changes: 5 additions & 0 deletions conectar.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    function conectar() {
    // aqui vai toda a rotina de connect...
    mysql_connect(....);
    }

    15 changes: 15 additions & 0 deletions threads.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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();
    }