TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   process and thread (http://www.talkphp.com/absolute-beginners/4466-process-thread.html)

zongliang 06-03-2009 03:36 AM

process and thread
 
hi,
I am novice in PHP, I have gotten a question.
Can we use process or thread in PHP?
Does it get anything with OS?
If we can, which function or class can be used?
thanks a lot!
Your reply will be appreciated.

Wildhoney 06-03-2009 10:45 AM

Sorry, I don't think I understand this question. Could you please elaborate?

sketchMedia 06-03-2009 08:18 PM

PHP has no native multi-threading support, however we can fork child processes.

http://uk2.php.net/pcntl

Wildhoney 06-03-2009 09:26 PM

I had an inkling that's what he meant, but he mentioned he was a novice. Forking to me is an advanced topic.

allworknoplay 06-04-2009 01:43 AM

Yeah you can really get into a lot of trouble with forking and loops if you're not careful...

zongliang 06-04-2009 03:49 AM

I am sorry.
My question is could we use signal, shared memory...(as used in C) in PHP?
If I was in windows, is the any problem?

allworknoplay 06-04-2009 02:20 PM

Quote:

Originally Posted by zongliang (Post 24890)
I am sorry.
My question is could we use signal, shared memory...(as used in C) in PHP?
If I was in windows, is the any problem?

memory management is all done by PHP on the back end, whether you are using windows, linux etc...

users don't have any control over memory management other than cleraring out variables and objects at the end of scripts...but even that is done automatically....

zongliang 06-05-2009 01:27 AM

Hi Allworknoplay,
thank you for you reply.
you are absolutely right, PHP do not have right to control memory.
Actually, signal, shared memory was used to send message between threads in C.
So my question is that "If I want to use thread in PHP, what function should I use? what will be used to send message between threads in PHP?"

Salathe 06-05-2009 09:48 AM

PHP does have the ability to play around with shared memory which may or may not be useful for you.

zongliang 06-05-2009 10:15 AM

Thank you, Salathe, it is useful for me.
So if I want to be advanced in PHP, I should use linux instead of windows!

sketchMedia 06-05-2009 10:23 AM

Quote:

So if I want to be advanced in PHP, I should use linux instead of windows!
Whilst I agree you should use Linux rather than Redmond, you don't have to use the penguin to be advanced at PHP, it just appears that most advanced topics of PHP need a proper operating system :-P


All times are GMT. The time now is 03:21 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0