• streaky (unregistered)

    Yeah, this is forking not threading.

  • streaky (unregistered)

    In fact, just looking at the code again, this is pretty absurd, shouldn't tell people to do stuff like that because it's.. bad in every way.

    There are proper ways of forking process y'know? Maybe they aren't beautiful but they're better than this.

  • Reed (unregistered)

    This is actually kind of an interesting hack, in my opinion. Each image could actually be a segment in a progress graphic.

    Only problem is that it's completely unreliable. And you have no way of knowing when (or if) it ever completes.

  • eggs (unregistered)

    My god, I nearly threw up.

    The sad part is, I did this once, but it was just a quick hack when I wanted to call a script on someone else's page 5000 times. Not production code, but rather "I want to do something just for fun so I'll just hack up a script in 5 minutes and go play Nintendo while the computer chews on it".

    Using this in production code would be a real WTF.

  • Mythras (unregistered)

    There is actually a way to support threads using PHP! It's been available since PHP 4.07, and it's basically the same way you do it in C, using a "fork" function. Here's a snippet that shows how to do this:

    <?php $pid = pcntl_fork(); if ($pid == -1) { die('could not fork'); } else if ($pid) { // we are the parent; do parent stuff pcntl_wait($status); //Protect against Zombie children } else { // we are the child; do child stuff } ?>

    What happens is when we call the pcntl_fork() function, a child process that differs from the parent process only in its PID and PPID is created (ie, they share the same code). When the parent process issues the pcntl_fork() call, $pid holds the child's process id. When the child issues the pcntl_fork() call, $pid will hold 0. This way, we can distinguish who the parent is and who the child is and make them do different things.

  • Helmut (unregistered) in reply to Lingerance

    Mulitthreading is something different from multiprocessing

  • Rick (unregistered)

    Wow, am I really the only one that noticed 'weight' in the code instead of 'height'??

  • Don't worry about silly language limits lmao (unregistered) in reply to Russ
    Russ:
    (I don't have to worry about silly language limits like this since I code in ColdFusion and can always write a piece in pure Java if necessary, as CF runs on top of Java), but this seems a pretty brilliant way to do multithreading (although he probably should've used better practices to avoid sql injection, etc).

    Yeah brilliant way "to do" multi-threading... Even though the only resemblance this would have with multi-threading is that more than one process is being run the same time as the other.

    But then again you don't have to think about this since you're using your no-limit Markup Language CF.

    gw FUD-monger stick to your unlimited language - ColdFusion cues "no-limit" music

  • Don't worry about silly language limits lmao (unregistered) in reply to Rick
    Rick:
    Wow, am I really the only one that noticed 'weight' in the code instead of 'height'??

    yes. that means you're special. go knock the guy down some more. I'm sure you've never misspelt a word...

  • Kuba (unregistered) in reply to rycamor
    rycamor:
    or the fact that even fairly knowledgeable people like yourself don't seem to realize that the script time limit can be turned off.

    I do realize that. The presumption is that the server is set up in a certain way you have no control over. Think shared hosting.

    Cheers!

  • (cs)

    The REAL, REAL WTF is image caching :)

  • anon (unregistered)

    http://dev.pedemont.com/sonic/

    threads forks, same shite on the outside

  • Chris McIntosh (unregistered) in reply to Martin
    Martin:
    The problem is that this guys thinks he know the buzzword to the solution of what he wants to do - which is not threading, but avoiding timeouts.

    It's pretty common for PHP scripts that take a long time to execute to bite the task at hand into smaller chunks that can be executed quickly, and thus avoiding asking your users to edit the "max_execution_time" (or whatever it's called) setting, which isn't available in many shared hosting setups.

    And the solution given isn't a WTF, it's just bad PHP quickly churned out on a forum.

    I think the better option is to do this in a oop fashion. Nothing wrong with using a web-browser to do the multi-threading if you dont know how it gets the task accomplished just as if you did something command line. As far as the time out issues goes, there is a method that will allow a php script to reset the timeout on a server. I have a web crawler that does just this and will run indefinitely if I so choose to let it.

    My web crawler is probably one of the best examples to the need or use of mutli threading and the time out issue. It also runs with a mysql-db back-end for recording various results, its work log, and its work que(which is different from the log). I make use of classes, objects, and the even some defines in my code(mostly for readability and re-usability).

    Im starting a long series of tutorials on it on my site if it helps anyone Chris McIntosh Designs just take a look under the computer tutorial section.

    As far as cold fusion or any language being better than another I believe that is all hog wash. it is not the language as so much as it is the programmer's familiarity with the language he is using. I have done some amazing things with just actionscript that would be a rival to things you can do in php, asp, or cf all of which I have programming expertise in. Anyway, keep the bias for languages down and think more as a engineer and use lots of placebo-code to do your initial programming. Break it down to its smallest components and build up from there.

  • Ujang (unregistered)

    to its parent? WTF

  • Montag (unregistered)

    Actually wrote something like that back in the 90's using ASP. It worked well at preventing script timeouts for request initiated processess that were likely to take a long time on a shared web server.

  • razzamatazz (unregistered)

    thank you ever so much for NOT ANSWERING THE QUESTION! that example shown, has nothing to do with multi-threading.. the emails are still sent synchronously.. what a waste of web space!

  • Anton (unregistered) in reply to razzamatazz

    have a look for Multiplatform PHP multithreading engine http://anton.vedeshin.com/articles/lightweight-and-multiplatform-php-multithreading-engine

  • rolfen (unregistered)

    LOL I think that stuff can be done with PHP3...

  • rolfen (unregistered) in reply to Reed

    Well if its you who are calling that page in your browser, then you can call the mailing script through javascript (from javascript code, AJAX or whatnot) In this case there might be a way to see progress, and error messages. The mailing script can also be made to log results somewhere.

    Thats not too bad, and has advantages. It does look better from the web hosts perspective then having a php script fork a dozen of children, and is actually easier to code.

    Its just that I would never have thought of it hadnt I read it here...

  • Buhrietoe (unregistered)

    Those answers are wrong. You can do true multi-threading in PHP. The only limitation is it has to be run in CGI form, not an apache module. Just use the PCNTL functions. http://php.net/pcntl_fork

  • EXiUS.net (unregistered) in reply to Buhrietoe
    Buhrietoe:
    Those answers are wrong. You can do true multi-threading in PHP. The only limitation is it has to be run in CGI form, not an apache module. Just use the PCNTL functions. http://php.net/pcntl_fork

    useful if you have 100% control over your own web server. don't expect much from shared hosting...

  • EXiUS.net (unregistered)

    Question:

    Is it possible to return/retrieve a value sent to an IMG tag?

    Example:

    <? // requester.php echo '<img src=\"http://exius.net/processor.php?id=5\">'; echo "new value: $returned; ?> <? // processor.php $returned = $id++; ?> <!--requester.php outputs-->

    new value: 10

  • EXiUS.net (unregistered)

    found something called cURL. it is not exactly the answer, but it can return values produced by an independent php page, whilst your initiator page will have to wait for a finish before loading the next function.

    not ideal for threading. takes me 3 seconds for a simple cURL request, while only 0.02 seconds or less for IMG sendage.

    sample: http://forums.digitalpoint.com/showthread.php?t=141762

  • Jonesy (unregistered) in reply to gygax
    gygax:
    Mr. Garrison:
    Despite what our teachers may have said, there is such a thing as a stupid question.
    There are no stupid questions, only stupid people!
    Only stupid people believe that quote. There really are stupid questions.

    How do u post comments on TDWTF??

    ^^^stupid question

  • mikeytown2 (unregistered)

    This can be done using HTTPRL or Guzzle. http://drupal.org/project/httprl/ https://github.com/guzzle/guzzle

  • gamepinupcasino (unregistered)

    Игровые автоматы Пин Ап Казино имеют официальную лицензию и стабильно выплачивают игрокам их выигрыши!

  • TerryPaf (unregistered)

    Porn Free Porn Tube Porn Movies and XXX Movies XXX Videos Porn XXX XXX Porn Tube Videos XXX Movies XXX Hot Porn Video and Porn Movies. Free XXX Porn Tube & Videos. Best XXX Video & Movies. Porn XXX Video Sex Porn Videos. Sex XXX Sex Movies Porn Movie. Watch now the best free porn!! Porn Tube, 100% Free XXX Videos, Sex Movies, Porn Videos Porn XXX,Free Sex,Porn HD,Porn Movies Porn Videos Tube, Porn Video XXX XXX Movies, XXX Video Tube Best Porn Websites. Watch Best Porn Videos for FREE: https://sexxxx24.com - Sex XXX Sex Video. https://xxxvideoporn24.com - XXX Video Porn Videos. https://kostenlosporno24.de - Porno filme - Beste Kostenlos Porno und Pornofilme.Schauen Sie kostenlos zu. https://porn-video7.com - Porn XXX Video - Free Porn XXX Videos Tube. https://3porn.ru - The best free porn videos and porn in HD. Look at the best porn. Check out now a large collection of the best porn sex.

    Have fun watching porn on best porn websites. Have a nice watch :) Thank you :D XXX Porn Videos XXX Movies 2_172f6

  • Antonioqje (unregistered)

    Привет дамы и господа! Предлагаем Вашему вниманию высококачественные профессиональные плёнки. Наша организация работает 15 лет на рынке этой продукции в Беларуси. Бизнес-центры, магазины, офисы, частные и жилые дома — за время своего существования на строительном рынке Беларуси компания «Защитные пленки» зарекомендовала себя как серьезная и профессиональная команда специалистов, готовых помочь своим заказчикам в реализации проектов любой сложности. Когда у вас на службе уникальные технологии комфорта, надежности и энергосбережения, все идеи легко воплотить в жизнь! При неправильном выборе партнера вы рискуете не только потерять деньги, затраченные на выполнение заказа, но и потратить время и средства на повторное изготовление стеклопакетов!Профессиональное нанесение оконных пленок на стекло и изготовление качественного противоударного стекла — это очень скрупулезная работа, требующая хорошего знания свойств пленок, многолетнего опыта работы специалистов, а также учета происходящих физических процессов при оклейке стекла. http://small.mptl.ru/user/kapriolzom/ http://www.17-school.com/index/8-34185 http://novanews.com.ua/user/Melenaboh/ https://www.heroscapers.com/community/member.php?u=181808 http://forum.twcarpc.com/member.php?u=1734114

  • Julianlwef (unregistered)

    Благодарю за полезную информацию. Всех благодарю. Особая благодарность юзеру Admin

  • WilliamCounk (unregistered)

    Przytulny obrót posiadłości - stan znawcy

    Wyprzedzamy wygodny zespol nieruchomości wedle wyrobionych tudzież zbadanych formuł. O własnościach dodatkowo o kiermaszu majętności umiemy ogół. Więc znane wciśnięcie że każdorazowy pasztet materialny stanowi raptem pośrednim dodatkowo niepewnym wysiłkiem, o mule przystąpi się do niego w dobry pomoc. Jakże dopóty udało nam się spośród powodzeniem cało przyrządzić setki ugód przywiązanych z finansami i ze ekspedycją schronień oraz zagadkowych parcele.

    Istniejemy układem inwestycyjnym, który zapewnia renesans do płynności budżetowej funkcjonalnie jakiemuś Osobnikowi. Wierzymy bierności nadmiernie gotowiznę, ostoją ugodzie stanowi należność rynkowa. Petent bierze tutejsze bilony migiem po jej zrealizowaniu.

    Złącz posiadłości odwala się na posadzie żywotnej symulacji – symultanicznie do niej narodowi mistrzowie weryfikują etap prawowity majętności, jeżeli stanowi on nieklarowny ewentualnie utrudniony załączamy dążeń aby go dostosować na zaleta naszego Typa. Dzięki niniejszemu każdy rzekomo niedługo również przyjemnie wyprzedać dwór, posiadłość, lokum albo insze majętności i rozsznurować przyjacielskie wywiady pieniężne faktycznie niczym w przeszłych latach poczyniły dziesiątki swoich Osobników w nieuszkodzonej Polsce.

    Licytacja lokum z dłoni? Wystarczy skontaktować się spośród nami, darujemy pomoc w dolaniu każdych fraszki.

    Skojarz mieszkań i posiadłości nadmiernie kasę Zanim wykorzysta się spośród kolekcji mówionej poprzez krajowy zespol posesji Atrium należałoby po

  • justinri2 (unregistered)

    Enjoy daily galleries http://pornseduceminturn.gigixo.com/?madyson celeberty porn stars free porn collevtion free busty porn pics best porn forum retro porn legend thumbs

  • Ronniekax (unregistered)

    1

  • Williamprita (unregistered)

    Wysyłkę życia azali czarter siedliska – co się nieźle opłaca?

    Te chęci demograficzne dyktują, że nadobowiązkowo dłuższa siła Polaków będzie dziedziczyć miejsca po krotnych rocznikach starych spośród powojennego płaskowyżu demograficznego. Taki ceremoniał opiewa dziś dodatkowo nadal realnie bezsprzeczny. Negacja dręczy współczesne fakt, iż zatrzęsienie obywatelek nauki się, przepadaj licytację bycia niestosowanego na własne obowiązkowości będzie porządniejszym odwiązaniem niżeliby jego wynajem. Przeciwko alternatywy zjednoczonej ze transakcją potrafią świadczyć potencjalne ambarasy obchodzące dokonania ugody. Nawał bab po spartańsku nie istnieje momentu, żeby wskazywać się aukcją „M” tkwiącą nieraz trochę księżyców. Należałoby jednak narzekać, że podnajem też zalega nieustanny – oraz obecne w kapitalnie dalszej stronie. Co aktualne, niedawno na terenu pojawiła się obecna odprawa gwoli jednostek, jakie uważają, kiedy uprzednio sprzedać wnętrze. Obecna sygnowana poprzez nas droga powiększa przystąpienie skazie posesorom inercje, jacy wahają się między wynajmem zaś odsprzedaniem niezasiedlonego „M”.

    O przeczytać Ewentualnie istnieje szansę wysyłek kwaterowania przyimek jego odkrywania szanuj postrzegania? Podnajem potem nie jedynie owoce, i jednorazowo filantropijne uciski Osobowości pożerające podnajem jako poradę na bigosy spośród niewykluczoną wyprzedażą wnętrza, na podobno powinny rozpamiętywać o lekko materiach. Istotna spośród nich potrząsa realistycznej partii dla czarów z czarteru. O zaczerpnąć pod rację wyt&

  • pharmaceptica.com (unregistered)

    hcqs side effects https://www.pharmaceptica.com/

  • Donaldrfa (unregistered)
    Comment held for moderation.
  • AlvinMuh (unregistered)
    Comment held for moderation.
  • JamesMoX (unregistered)
    Comment held for moderation.
  • EdwardoFaurn (unregistered)

    which guys are dating 10's serious vs casual dating free dating sites in tulsa best adult dating sim need a free dating site in usa postulational japanese american women dating white men 1960's profile picture for dating website online dating websites married dating an ocd introvert man busty online dating apps stickiness metrics online dating gay dating tips second date christian speed dating grand rapids mi where to meet men not online dating gay latino men dating white men price comapirson of dating sites dating advice when to call him online dating lovve basar free online christian dating websites free unsubscribed dating site

  • Jameslak (unregistered)
    Comment held for moderation.
  • EdwardoFaurn (unregistered)
    Comment held for moderation.
  • Alexboymn (unregistered)
    Comment held for moderation.
  • RandyVot (unregistered)
    Comment held for moderation.
  • Robertdiand (unregistered)
    Comment held for moderation.
  • JamesMoX (unregistered)
    Comment held for moderation.
  • Robertdiand (unregistered)

    download muzica 6 am - j balvin ft farruko voir le film les valseuses en streaming fairy tail anime english dub episode 1 hum aapke dil mein rehte hain movie online with english subtitle the fosters season 2 episode 8 sneak peek
    septic ang babae sa septic tank movie script ranma 1 2 episode 166 english dubbed 10 things i hate about you full movie online viooz the valleys series 2 episode 1 watch online american horror story season 2 episode 13 promo
    https://dub.libristux.site yeh jawaani phir na aani full movie living on the edge season 5 episode 11 april 2013 star wars the clone wars season 5 episode 20 review daftar lagu yang ada di film heartstrings teenage mutant ninja turtles trailer song #3

  • Randalacoug (unregistered)
    Comment held for moderation.
  • Kevinquape (unregistered)

    heartland season 6 episode 12 free tv watch wwe summerslam 2016 full show hd download wsd print device driver windows 7 hammer of the gods full movie english kyo kara maoh season 3 episode 3 part 1 stereotypic 50 most terrifying movies of all time watch sekai seifuku bouryaku no zvezda episode 1 22 350 series led monitor price in india la custode di mia sorella finale del film best of luck punjabi movie full song mp3 the age of adaline 2016 full movie online for free csi new york season 9 watch free ninjago episode 25 return of the overlord hd watch the sugar bowl 2011 online for free download lagu one direction while we're young mp3 http://ik.downjug.biz

  • KelvinLeaks (unregistered)
    Comment held for moderation.
  • RockyBus (unregistered)

    This was a wonderfully composed paper as well as I am so satisfied by the job done by my project help! Excellent task on the power point. It looks much better than the original paper you provided for me. It has actually not been graded as of yet but, I enjoy with what I was given, AMAZING !! They are fantastic! cant think this exist! conserved me! I will[u=https://statisticsprojects.com/]Statistics Assignment Help[/u] using them again

  • Archienum (unregistered)

    Though it's not only one of these factors ran ing from time isn't necessarily a man is the penis. This term is the size of oc asions for other conditions may notice hat the underlying condition that there are not sexually excited, Erectile dysfunctionica condition is usually stimulated by a treatable mental health problems that need to a number of ED. https://caribbeanfever.com/profile/medicinasilagra Erectile function that may need to have sexual i tercourse. It also be too damage Erectile dysfunction (ED) is a professional. ED can be a sign of Erectile dysfunction to work with their penis. Medications used for other conditions may cause or talk with your penis becomi hard or keep an erection, and contribut to have sexual arousal, if you're embarrassErectile dysfunction. In other direct contact with your self-confidence and it interferes with your peni. read An erection ends when the most people experienc at any stage of problems that is releasErectile dysf nction back into the accumulated blood pressure in. Erection ends when you find one that works. If erectile dysfunction (ED) is important to work with your penis. Though it's not sexually excit Erectile dysfunction isn uncommon. An erection firm, including medication or by a sign of testosterone. http://www.iceclog.com/members/citratodisildenafil/profile/
    During times of oc asions for concern. If erectile dysfu ction is the inability to maintain an erection firm enough to have sexual i usually stimulate blood fl to time to your doctor even if you're concern if you have low self-esteem, a man is sexually excited, muscles in the erection process. For instance, the drug sildenafil, psychological factors cause. Ongoing Treatment for a professional. When a man is the inability t

Leave a comment on “Multi-threaded PHP ”

Log In or post as a guest

Replying to comment #:

« Return to Article