|
Posted by Henk Verhoeven on 08/24/05 02:03
Shailesh Patel wrote:
> I just want to know about..is it possible to implement
> threading concept in php
Hi Shailesh,
Maybe something like sending a http request to your own server could do
that. But if you use the file() function it will block the sending
thread until the result is received, and that will only happen when the
receiving thread is finished. But maybe there is a way out of this, like
curl multi-exec, see
http://www.php.net/manual/en/function.curl-multi-exec.php
But do you really need all this? Maybe you already have some external
source of concurrent http requests. This will be the case if you are
building a website, of if your app acts as a web service, see
http://www.php.net/manual/en/ref.soap.php.
Once you have concurrent threads, you will find that these threads have
no way to communicate, as each runs in its own memory space. But there
is something like shared memory, see http://www.php.net/shmop. That will
bring you into the realm of race conditions, locking and deadlocks you
seem to looking for, see http://www.php.net/manual/en/ref.sem.php
Greetings,
Henk Verhoeven,
www.phppeanuts.org.
Navigation:
[Reply to this message]
|