Re: Child Threads
It sounds like that's a sequential-parallel process, not a parallel-parallel one? I.e. you have to convert the PDF to image before you can slice the image up, but you CAN post-process the images in parallel. Can you not do this (in psuedo-code) imageArray = pdfToImage(myPdf); threadArray = []; for (image in imageArray) { threadArray.add(new thread(image) { doStuffToImage(image); }) } joinThreads(threadArray); So you'll do the pdfToImage first, and then loop over each page's image spawning a thread per page so they all process in parallel. To answer your first question, if you use CFHTTP, you get a new context. The no-nesting limitation is within a single CFML request, so if you initiate another request, you get a new (empty) threading context. Note that while this lets you spawn new threads, it means you CAN'T interact with the original request's threads. cheers, barneyb On Wed, Oct 28, 2009 at 12:32 PM, Stefan Richter wrote: > > Thanks Barney. > What may be a good workaround for the child threads problem? Could I > hit another CFM script via cfhttp from within my first thread and have > tat CFM spawn another thread, or is that still consider a child thread > then? > Basically I have 2 or 3 long running processes (image conversions and > manipulations) which should be chained somehow. For example I need to > first kick off a PDF to image conversion via cfpdf after a user > uploads a file. After that process is complete I need to rename and > sometimes cut up the generated images, or apply a different > compression setting, resize them etc. > Each step can take a few minutes. > > Yes I could use some sort of polling mechanism but that's not slick > enough ;-) > > Cheers > > Stefan > > > > > > On 27 Oct 2009, at 22:46, Barney Boisvert wrote: > >> >> No limit to threads on Enterprise Edition, but no CF edition allows >> child threads. Total buzzkill. Fortunately, with native threads can >> be leveraged with Groovy or JavaLoader's CFC-based dynamic proxies. >> Neither one is particularly elegant, but at least you can do it, since >> CF itself doesn't provide the tooling. >> >> cheers, >> barneyb >> >> On Tue, Oct 27, 2009 at 3:43 PM, Stefan Richter > > wrote: >>> >>> Quick question: does the CF Enterprise edition allow child threads? >>> Also is there a limit of threads with that edition? >>> >>> Cheers >>> >>> Stefan >>> >>> >>> > > > ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327802 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Child Threads
Thanks Barney. What may be a good workaround for the child threads problem? Could I hit another CFM script via cfhttp from within my first thread and have tat CFM spawn another thread, or is that still consider a child thread then? Basically I have 2 or 3 long running processes (image conversions and manipulations) which should be chained somehow. For example I need to first kick off a PDF to image conversion via cfpdf after a user uploads a file. After that process is complete I need to rename and sometimes cut up the generated images, or apply a different compression setting, resize them etc. Each step can take a few minutes. Yes I could use some sort of polling mechanism but that's not slick enough ;-) Cheers Stefan On 27 Oct 2009, at 22:46, Barney Boisvert wrote: > > No limit to threads on Enterprise Edition, but no CF edition allows > child threads. Total buzzkill. Fortunately, with native threads can > be leveraged with Groovy or JavaLoader's CFC-based dynamic proxies. > Neither one is particularly elegant, but at least you can do it, since > CF itself doesn't provide the tooling. > > cheers, > barneyb > > On Tue, Oct 27, 2009 at 3:43 PM, Stefan Richter > wrote: >> >> Quick question: does the CF Enterprise edition allow child threads? >> Also is there a limit of threads with that edition? >> >> Cheers >> >> Stefan >> >> >> ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327801 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Child Threads
No limit to threads on Enterprise Edition, but no CF edition allows child threads. Total buzzkill. Fortunately, with native threads can be leveraged with Groovy or JavaLoader's CFC-based dynamic proxies. Neither one is particularly elegant, but at least you can do it, since CF itself doesn't provide the tooling. cheers, barneyb On Tue, Oct 27, 2009 at 3:43 PM, Stefan Richter wrote: > > Quick question: does the CF Enterprise edition allow child threads? > Also is there a limit of threads with that edition? > > Cheers > > Stefan > > > > ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327781 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Child Threads
Quick question: does the CF Enterprise edition allow child threads? Also is there a limit of threads with that edition? Cheers Stefan ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327780 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4