Page 1 of 1
Multi-threading/Forking VS Ajax or a combination
Posted: Mon Jun 01, 2009 2:12 pm
by jaoudestudios
If a web page has 6 ajax calls, is that effectly like multi-threading/forking in php? or can both be combined for even greater benefit?
Re: Multi-threading/Forking VS Ajax or a combination
Posted: Mon Jun 01, 2009 5:59 pm
by Attilitus
I doubt you would get much benefit from trying to give PHP multi-threading capabilities. Is there something specific in your script that you think would benefit from multithreading?
Re: Multi-threading/Forking VS Ajax or a combination
Posted: Mon Jun 01, 2009 9:17 pm
by requinix
Multi-threading and AJAX may seem similar but they're very different ideas.
Multiple threads is like having 10 grocery cashiers ringing up your items. AJAX is like sending 10 different people to each buy a different fraction of your shopping list.
Re: Multi-threading/Forking VS Ajax or a combination
Posted: Mon Jun 01, 2009 9:26 pm
by s.dot
Personally I wouldn't bother with trying to achieve a multi-threading effect in PHP. It just can't be done... effectively/proficiently.
Re: Multi-threading/Forking VS Ajax or a combination
Posted: Mon Jun 01, 2009 11:25 pm
by jaoudestudios
Thanks for your feed back guys!
tasairis wrote:Multi-threading and AJAX may seem similar but they're very different ideas.
Multiple threads is like having 10 grocery cashiers ringing up your items. AJAX is like sending 10 different people to each buy a different fraction of your shopping list.
I like this analogy. I appreciate they are different but the result is similar ish, right?
Re: Multi-threading/Forking VS Ajax or a combination
Posted: Tue Jun 02, 2009 12:01 am
by requinix
Multiple threads are more about efficiency (splitting one task into many smaller tasks); AJAX is more about nicer interfaces (not needing a page refresh to do something).
Re: Multi-threading/Forking VS Ajax or a combination
Posted: Tue Jun 02, 2009 12:48 am
by jaoudestudios
tasairis wrote:Multiple threads are more about efficiency (splitting one task into many smaller tasks); AJAX is more about nicer interfaces (not needing a page refresh to do something).
Yes, but if I have 10 parts of the page going off at the same time to do ajax, then surely that is similar to multi-threading?
Re: Multi-threading/Forking VS Ajax or a combination
Posted: Tue Jun 02, 2009 1:51 am
by requinix
But not in PHP. You could say the JavaScript is multitasking (some people will get antsy if you say "multi-threading", even if that's what's really going on behind the scenes) but PHP (as far as you're concerned) is not.