Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Czy ktoś zna się na obsłudze wątków w PHP 5 ?
tajga
post 5.09.2003, 16:22:18
Post #1





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 17.06.2003
Skąd: Konstanci-Jeziorna

Ostrzeżenie: (0%)
-----


A może jakiś inny sposób uzyskania wątków w windzie ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
Seth
post 5.09.2003, 16:38:27
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 335
Pomógł: 6
Dołączył: 7.03.2002

Ostrzeżenie: (0%)
-----


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.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.07.2025 - 16:58