Skip to content

Instantly share code, notes, and snippets.

@mrsimonbennett
Created March 2, 2014 12:50
Show Gist options
  • Save mrsimonbennett/9306110 to your computer and use it in GitHub Desktop.
Save mrsimonbennett/9306110 to your computer and use it in GitHub Desktop.
Added Small Sleep
public function SpawnWorker($task)
{
for($i = 0; $i < $this->size; $i++)
{
$this->workers[$i] = new Worker($i,$this->loader);
$this->workers[$i]->start();
$this->workers[$i]->stack($task);
usleep(100); //Stops Crash
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment