Page 1 of 2

Can you have multiple threads in PHP?

Posted: Tue Aug 15, 2006 8:01 pm
by ZeroFear
Can you create multiple threads in php?

Posted: Tue Aug 15, 2006 8:04 pm
by feyd
Nope.

Posted: Tue Aug 15, 2006 8:12 pm
by RobertGonzalez
Short threads. Nice.

Posted: Tue Aug 15, 2006 8:27 pm
by Weirdan
No Everah, in php you can't create even short threads :D

Posted: Tue Aug 15, 2006 8:29 pm
by sweatje
feyd wrote:Nope.
That was a little verbose. I think
No.
would have sufficed.

Posted: Tue Aug 15, 2006 8:39 pm
by feyd
sweatje wrote:That was a little verbose. I think
No.
would have sufficed.
Probably, but since I knew what the answer would be before opening the thread, I had to consider the breviloquence of such a message. Based on this conundrum, I chose the more grandiloquent, while still inherently specific and finite .. phrase.

Posted: Tue Aug 15, 2006 9:27 pm
by RobertGonzalez
feyd wrote:
sweatje wrote:That was a little verbose. I think
No.
would have sufficed.
Probably, but since I knew what the answer would be before opening the thread, I had to consider the breviloquence of such a message. Based on this conundrum, I chose the more grandiloquent, while still inherently specific and finite .. phrase.
Things to do...
Look up breviloquence
Look up conundrum
Look up grandiloquent
Egg my English teachers house for not teaching me those words

@weirdan: I had no idea that came out the way it did... Short threads, Ha! I hadn't even paid attention to the fact that this thread was about threads and that replying with the word thread was inherently going to cause me to look like a caught unawares @$$.

Posted: Tue Aug 15, 2006 11:36 pm
by Weirdan
Things to do...
Look up breviloquence
Look up conundrum
Look up grandiloquent
Egg my English teachers house for not teaching me those words
Heh, how does it feel to be in my shoes? :D

To understand 'breviloquence' I had first to lookup this term in the wikipedia and then use multitran.ru to translate the definition to Russian :). On the other hand, once you know what breviloquence is you could guess what 'grandiloquent' means :D

Posted: Tue Aug 15, 2006 11:46 pm
by Benjamin
Chapter 5 of Advanced PHP Programming, page 130, "Create and Managing Child Processes" explains this.
PHP Supports traditional Unix multitasking by allowing a process to spawn child processes via pcntl_fork()...

Posted: Wed Aug 16, 2006 3:45 am
by Weirdan
processes and threads are completely different things.

Posted: Mon Aug 21, 2006 4:03 pm
by sweatje
feyd wrote:
sweatje wrote:That was a little verbose. I think
No.
would have sufficed.
Probably, but since I knew what the answer would be before opening the thread, I had to consider the breviloquence of such a message. Based on this conundrum, I chose the more grandiloquent, while still inherently specific and finite .. phrase.
I appreciated your messages affability. It had an air of congeniality, without the aloof connotations of the more concise version. Even in your subsequent repartee, you had no need to resort to truly sesquipedalian vocabulary. You definitely have the penultimate vocabulary on PHPDN ;)

Posted: Tue Aug 22, 2006 12:08 am
by RobertGonzalez
!?!?!?!??!?!?!?

I feel so am stoopid.Image

Posted: Tue Aug 22, 2006 12:13 am
by Luke
Weirdan wrote:To understand 'breviloquence' I had first to lookup this term in the wikipedia and then use multitran.ru to translate the definition to Russian :).
Wow... I hadn't noticed it says Ukraine in your location. Your (bulletin board) english is indistiguishable from the rest of the regular posters here.

Posted: Tue Aug 22, 2006 2:45 am
by pedrotuga
Everah wrote:Short threads. Nice.
Weirdan wrote:No Everah, in php you can't create even short threads
Everah wrote:!?!?!?!??!?!?!?

I feel so am stoopid.
looll.... R-O-T-F-F-L!
ehehehe this is one of the gratest piece of humor i heard lately

Posted: Tue Aug 22, 2006 3:35 am
by Rovas
In the OS Windows you can' t have multithreading for PHP in UNIX you can have using what astions said.
Some clarification on threads or process
A process is the "heaviest" unit of kernel scheduling. Processes own resources allocated by the operating system. Resources include memory, file handles, sockets, device handles, and windows. Processes do not share address spaces or file resources except through explicit methods such as inheriting file handles or shared memory segments, or mapping the same file in a shared way. Processes are typically pre-emptively multitasked. However, Windows 3.1 and older versions of Mac OS used co-operative or non-preemptive multitasking.

A thread is the "lightest" unit of kernel scheduling. At least one thread exists within each process. If multiple threads can exist within a process, then they share the same memory and file resources. Threads are pre-emptively multitasked if the operating system's process scheduler is pre-emptive. Threads do not own resources except for a stack and a copy of the registers including the program counter.
For more information on threads and process visit http://en.wikipedia.org/wiki/Multithreading