2 Replies Latest reply on May 6, 2013 11:11 PM by yinchuangye

    cfthread of coldfusion on different systems-windows and RedHat

    yinchuangye

      Recently I use cfthread writing a multithread samples. Each thread ask a http request.When I run this cfc file with coldfusion9 on windows, it runs well. Then I run the same cfc file on coldfusion9 on linux(RedHat and centOS), unfortunately, it seems do not work, I found the multi thread do not run parallely, they run one by one. The both coldfusion configuration files are same, and the web server use the built-in one of coldfusion. Is there anyone meet the same probelm? And is there something wrong with cfthread to run on linux? Really need your help. Many thanks!

        • 1. Re: cfthread of coldfusion on different systems-windows and RedHat
          BKBK Adobe Community Professional & MVP

          Could we see the code? Then it would be easier to debug it.

          • 2. Re: cfthread of coldfusion on different systems-windows and RedHat
            yinchuangye Level 1

            <cfloop index="pageIndex" from="1" to="#num#" step="1">

                                    <cfthread name="thr#pageIndex#" threadIndex="#pageIndex#" action="run">

                                                    <cftry>

                                                        <cfhttp url="#watson_url#"  method="post" charset="utf-8" timeout="26000000" useragent="#CGI.http_user_agent#" result="THREAD.GETTREAD">

                                                   <cfhttpparam type="formfield" name="appGUID" value="#guid#">

                                                   <cfhttpparam type="formfield" name="userId" value="#user_id#">

                                                   <cfhttpparam type="formfield" name="password" value="#user_pass#">

                                                   <cfhttpparam type="formfield" name="sql" value="#TempArr[threadIndex]#">

                                                      </cfhttp>

                                                      <cfset result_Arr = #DeserializeJSON(THREAD.GETTREAD.Filecontent)#>

                                                      <cfset resultArr[threadIndex]=result_Arr >

                                                     

                                                      <cfcatch type="any">

                                              </cfcatch>

                                                </cftry>

                                 

                                   </cfthread>

                 </cfloop>

            TempArr is an array for sql,each thread run a sql and get result from http request.