Multi-threading/Forking VS Ajax or a combination
Moderator: General Moderators
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Multi-threading/Forking VS Ajax or a combination
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
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
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.
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
Personally I wouldn't bother with trying to achieve a multi-threading effect in PHP. It just can't be done... effectively/proficiently.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Multi-threading/Forking VS Ajax or a combination
Thanks for your feed back guys!
I like this analogy. I appreciate they are different but the result is similar ish, right?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.
Re: Multi-threading/Forking VS Ajax or a combination
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).
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Multi-threading/Forking VS Ajax or a combination
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?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).
Re: Multi-threading/Forking VS Ajax or a combination
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.