PHP Classes
Icontem

Class: Multi-thread Simulation


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Alex Lau  >  Multi-thread Simulation  >  Download  >  Support forum Support forum (1)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Multi-thread Simulation Support forum
Base name: thread
Description: Emulate threads using separate HTTP requests
Related top rated classes:
Version: 0.0
Required PHP version: 4.0
License: GNU General Public License (GPL)
All time users: 2733 users
All time rank: 817
Week users: 27 users
Week rank: 195
 
  Author   Group folder image Groups   Detailed description  
  Rate classes User ratings   Trackback   Applications   Files Files  

Author

Picture of Alex Lau
Name: Alex Lau is available for providing paid consulting. Contact Alex Lau .
Published packages: 2 Browse this author's classes Browse this author's classes
Country: Hong Kong Hong Kong - PHP jobs in Hong Kong
Home page: ???
Age: 21
All time rank: 592
Week rank: 241

Innovation Award

PHP Programming Innovation award nominee
July 2007
Number 2
Some applications need to perform several tasks that may take a while to finish. When there are many tasks to execute, it may take a long time to finish all of them if they are executed sequentially, i.e. one after another.

A possible solution for this problem is to execute several tasks at the same time using separate processes or threads.

PHP has the pcntl extension that can be used to run multiple processes in parallel. However, this extension is only available in Linux or Unix like operating systems.

This package provides an alternative solution that consists in sending multiple HTTP requests to the same Web server on which PHP is running.

Each HTTP request triggers the execution of a different task. Many requests can be run at the same time without having to wait for each one to finish.

This solution can run in Windows and all other operating systems supported by PHP, including PHP environments on which the pcntl extension is not installed.

Manuel Lemos

Groups

Group folder image HTTP HTTP protocol clients, headers and cookies View top rated classes
Group folder image Utilities and Tools General purpose tools to simplify software development View top rated classes
Group folder image Language Constructs to assist in the language control View top rated classes

Detailed description

This class can emulate the execution of program threads using separate HTTP requests to the same script.

It establishes an HTTP connection to the same Web server to execute the same PHP script. It sends a request passing the name a function to execute and an argument to be passed to that function.

The requested script executes some code that detects the thread execution request and calls the specified function.

When the thread request script ends, the return values of the called function is returned as a serialized string.

The calling script can execute other tasks while the thread script runs. The results may be collected later when the thread script ends.

User ratings

There are not enough user ratings to display for this class.

Trackback links

Link Description
Improved Thread Simulation Class for PHP Threads. Most PHP scripts do just fine without them...
PHP Multithreading Immagino che ai più le due parole del titolo suonino abbastanza male, in effetti php per sua natura non supporta i thread, il che è palesemente ovvio visto che è un linguaggio di scripting nato per fare tutt’altra cosa...
PHP Multithreading - Faking It PHP doesn’t really support multi-threading per se but there are ways to do “fake” multithreading...

Applications that use this class

No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.

Files

File Role Description
Plain text file test.php Example An example
Plain text file Thread.php Class The main class
Download all files: thread.tar.gz thread.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products