<?php class Task extends Threaded { private $value; public function __construct(int $i) { $this->value = $i; } public function run() { $s=0; for ($i=0; $i<10000; $i++) { $s++; } echo "Task: {$this->value}\n"; } } # Create a pool of 4 threads $pool = new Pool(4); for ($i = 0; $i < 15000; ++$i) { $pool->submit(new Task($i)); } while ($pool->collect()); $pool->shutdown();
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
bayadic-app | Folder | 0755 |
|
|
bayadic-status | Folder | 0755 |
|
|
bot | Folder | 0755 |
|
|
botdev | Folder | 0750 |
|
|
dict | Folder | 0755 |
|
|
diplom | Folder | 0755 |
|
|
library | Folder | 0755 |
|
|
site | Folder | 0333 |
|
|
sounds | Folder | 0755 |
|
|
telegram | Folder | 0755 |
|
|
var | Folder | 0755 |
|
|
vendor | Folder | 0755 |
|
|
client.html | File | 4.23 KB | 0664 |
|
composer.json | File | 125 B | 0644 |
|
composer.lock | File | 32.19 KB | 0644 |
|
fastest.php | File | 474 B | 0644 |
|
index.nginx-debian.html | File | 612 B | 0644 |
|
index.php | File | 64 B | 0644 |
|