Przerabialem ten temat jakis czas temu.
W samym php nie da sie tego zrobic pod Winda. Chociaz raz natknalem sie na ciekawe rozwiazanie:
Cytat
Here is an example of multi-tasking / multi-threading:
# declare functions
function a() {
echo "a";
}
function b() {
echo "b";
}
# register tick functions
register_tick_function ("a");
register_tick_function ("b");
# make the tick functions run
declare (ticks=1);
# that's all there is to it.
Notes:
This will make functions a and b run once each at the same time.
If you try:
declare (ticks=1) {
1;
}
They will run twice each. That is because it seems to be an undocumented fact that there is always an extra tick.
Therefore:
declare (ticks=2) {
1;
}
Will cause them to run once.
Mozna byo by powalczyc z funkcjonalnoscia Javy ale umnie to nie poszlo tak samo jak i stworzenie osobnej aplikacji w c++ do tworzenia watkow.
php 5 nie wprowadzi niestety nowosci w tej kwestji.