informatique:php:multithread
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| informatique:php:multithread [28/07/2025 16:04] – [Multithread en PHP] cyrille | informatique:php:multithread [28/07/2025 16:16] (Version actuelle) – [Queue Systems] cyrille | ||
|---|---|---|---|
| Ligne 5: | Ligne 5: | ||
| * Php8 fibers | * Php8 fibers | ||
| * It is important the concurrent execution does not mean simultaneous execution. The Fiber and the main execution flow does not happen at the same time. It is up to the main execution flow to start a Fiber, and when it starts, the Fiber is executed exclusively. The main thread cannot observe, terminate, or suspend a Fiber while the Fiber is being executed. | * It is important the concurrent execution does not mean simultaneous execution. The Fiber and the main execution flow does not happen at the same time. It is up to the main execution flow to start a Fiber, and when it starts, the Fiber is executed exclusively. The main thread cannot observe, terminate, or suspend a Fiber while the Fiber is being executed. | ||
| + | * https:// | ||
| * https:// | * https:// | ||
| * Revolt is a rock-solid event loop for concurrent PHP applications. The usual PHP application spends most of its time waiting for I/O. While PHP is single threaded, cooperative multitasking can be used to allow for concurrency by using the waiting time to do different things. | * Revolt is a rock-solid event loop for concurrent PHP applications. The usual PHP application spends most of its time waiting for I/O. While PHP is single threaded, cooperative multitasking can be used to allow for concurrency by using the waiting time to do different things. | ||
| * https:// | * https:// | ||
| * ReactPHP is a low-level library for event-driven programming in PHP. | * ReactPHP is a low-level library for event-driven programming in PHP. | ||
| + | * https:// | ||
| + | * AMPHP provides higher-level libraries using non-blocking I/O under the hood. Fibers allow these libraries to just work, no matter whether they' | ||
| ===== Utilisation de " | ===== Utilisation de " | ||
| Ligne 16: | Ligne 19: | ||
| [[http:// | [[http:// | ||
| [[http:// | [[http:// | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | Utilisez l’extension de concurrence parallèle Parallel pour réaliser le multithreading en PHP: | ||
| + | * https:// | ||
| + | * parallel requires a build of PHP with ZTS (Zend Thread Safety) enabled (--enable-zts, | ||
| ===== Multiplexing ===== | ===== Multiplexing ===== | ||
| Ligne 24: | Ligne 33: | ||
| Une utilisation astucieuse des streams permet d’effectuer simultanément plusieurs requêtes. La méthode est expliquée par [[http:// | Une utilisation astucieuse des streams permet d’effectuer simultanément plusieurs requêtes. La méthode est expliquée par [[http:// | ||
| + | ==== Queue Systems ==== | ||
| + | |||
| + | Consommer des jobs via Redis, Beanstalkd. | ||
| ==== Utilisation de Curl ==== | ==== Utilisation de Curl ==== | ||
informatique/php/multithread.1753711492.txt.gz · Dernière modification : de cyrille
