문제

Looking at some legacy code and the programmer in question uses:

<cfthread action="run">
    <cfexecute name="c:\myapp.exe" timeout="30">
</cfthread>

Can one safely replace the code above with this?

<cfexecute name="c:\myapp.exe" timeout="0">

Is CF going to spawn up a thread in the code above anyway? And is the thread going to be counted towards "Maximum number of threads available for CFTHREAD"?

도움이 되었습니까?

해결책

If the intent is to have a non-blocking flow of the code, then you can safely replace the earlier code with yours.

In my understanding, CF is not creating a thread when it gets a timeout="0". It must be just calling the exe (which creates a new process on server) and never wait for the process to reply. So, nothing is added to the thread limit count.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top