Geen cache-versie.


Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.

Rechercher une fonction PHP

Introduction

pht is a new threading extension for PHP. It enables for classes, functions, and even entire files to be threaded. Currently, pht can only be used with PHP 7.2. This is due to ZTS mode being unsafe in PHP 7.0 and 7.1. Support for PHP >7.2 is coming soon.

Warning

The pht extension should not be used in a web server environment. Threading should be restricted to CLI-based applications only.

The approach to threading that pht takes is to abstract away the thread itself behind a dedicated object (pht\Thread). Tasks are then added to the thread's internal task queue, where they are processed when the thread is started (via pht\Thread::start()).

All thread tasks will execute in isolation inside of the newly spawned thread. For class tasks, this means the spawned objects cannot be passed around between threads. By keeping the threading contexts completely separate from one-another, there becomes no need to serialise the properties of threaded objects (which is a necessary evil if such objects have to operate in multiple threads).

The isolation of threading contexts makes the passing around of data between them somewhat problematic. To solve this problem, threadable data structures (pht\HashTable, pht\Vector, and pht\Queue) have been implemented to allow for a two-way communication style between threads, where they expose mutex locks to control their integrity. These data structures can be safely passed around between threads, and manipulated by multiple threads using the mutex locks that have been packed in with them. They are reference-counted across threads, and so they do not need to be explicitly destroyed. This approach to threading means that only the given built-in data structures need to be safely passed around between threads.

Atomic values are also supported by pht. Currently, only an pht\AtomicInteger class exists. Like the threaded data structures, it too can safely be passed around between threads.

Zoek een PHP-functie

Vertaling niet beschikbaar

De PHP-handleiding is nog niet in het Nederlands vertaald, dus het scherm is in het Engels. Als u wilt, kunt u het ook in het Frans of in het Duits raadplegen.

Als je de moed voelt, kun je je vertaling aanbieden ;-)

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 30/01/2003 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/php-rf-intro.pht.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : http://php.net

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut