Jump to content

Search the Community

Showing results for tags 'multiple instances compiled'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I am launching multiple instances (16) of a compiled exe with different command line parameters. Even though the program completed its execution, (i have _filewritelog for execution start & complete) the program is still running in the Process Explorer (not always but randomly). I couldn't find any specific pattern of when and at what circumstances this happens. I have a clear Exit/Return commands at the end of the program, but still it doesn't help. When I tried with the original .au3 script itself instead of compiled exe, same behavior is observed. Kind of struck of how to proceed further...Any help would be greatly appreciated! Update-1: When I enabled "TrayIconDebug" and after few minutes of running the tray icons went away(which means program completed) but still the process exist and running in the process explore. PFA the snapshot. Launch Instance (Wrapper) Program: ============================ AutoItSetOption("TrayIconDebug",1) #include "Include_Hourly_4GCORE.au3" Global $BaseTime = "" Global $NoOfHoursToCheck4ReRun = 24*4 Global $TimeStamp = @MON & @MDAY & @YEAR & "-" & @HOUR & @MIN & @SEC Global $LogDir = @ScriptDir & "\ScriptLogs\" Global $LogFile = "TMP2_Hourly-4GCORE-Wrapper-Log-" & $TimeStamp & ".txt" Global $LogPathNFile = $LogDir & $LogFile Launch_MissingFile_Update() Exit ;Functions ; This function first launches 16 instances with different command line params and as and when any of the instances completed execution, it then launches additional instances until ; all instances are launched ; Func Launch_MissingFile_Update() WriteLog("[Info] Launching parallel parser for Missing Files Update...") $FileCntArray=DirGetSize($Temp2Dir,1) $Total_ReRunFiles=0 If Not @error Then $Total_ReRunFiles=$FileCntArray[1]-1 WriteLog("[Info] Found " & $Total_ReRunFiles & " entries to ReRun") EndIf Local $CSVSearch = FileFindFirstFile($Temp2Dir & $MissingFileExport) If $CSVSearch = -1 Then WriteLog("[Error] No files/directories matched the search pattern - " & $Temp2Dir & $MissingFileExport) Return $C_FAIL EndIf Local $sFileName = "" Local $FileCnt=1 While 1 $sFileName = FileFindNextFile($CSVSearch) ; If there is no more file matching the search. If @error Then WriteLog("[Info] Launched all the CSV Files...") ExitLoop EndIf $sFileNameNPath = $Temp2Dir & $sFileName ;$PID=Run(@AutoItExe & " " & $BaseDir & "ReRun_MissingFiles.au3 " & $sFileNameNPath & " " & $FileCnt,"",@SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD) $PID=Run($BaseDir & "TMP2_ReRun_MissingFiles.exe " & $sFileNameNPath & " " & $FileCnt,"",@SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD) Assign("ReRun_PID_" & $FileCnt,$PID) WriteLog("[Info] Adding PID# [" & $FileCnt & " Of " & $Total_ReRunFiles & "] " & $PID) If $FileCnt >= $TMP2_NoOfReRunInstances Then While 1 $NoOfActivePIDs=0 For $z=1 To $FileCnt If ProcessExists(Eval("ReRun_PID_" & $z)) Then $NoOfActivePIDs += 1 Next If $NoOfActivePIDs < $TMP2_NoOfReRunInstances Then ExitLoop WEnd EndIf Sleep(2000) $FileCnt += 1 WEnd $FileCnt -= 1 ; Close the search handle. FileClose($CSVSearch) WriteLog("[Info] before loop filecnt is " & $FileCnt) WriteLog("[Info] Waiting for all ReRun Processes to complete...") While 1 $NoOfActivePIDs=0 For $z=1 To $FileCnt If ProcessExists(Eval("ReRun_PID_" & $z)) Then $NoOfActivePIDs += 1 If @SEC=01 And Sleep(50) Then WriteLog("[Info] PID# " & $z & " - " & Eval("ReRun_PID_" & $z) & " exists.") EndIf Next If $NoOfActivePIDs <= 0 Then ExitLoop ;~ If @SEC=01 And Sleep(1000) Then WriteLog("[Info] Still " & $NoOfActivePIDs & " active PIDs exists...") WEnd WriteLog("[Info] All [ReRun] Processes completed...") EndFunc Actual Program: ============ #include "Include_Hourly_4GCORE.au3" AutoItSetOption("TrayIconHide",1) ;Map command-line parameters Global $InputCSVFile=$CmdLine[1] Global $InstanceNo=$CmdLine[2] Global $LogDir = @ScriptDir & "\ScriptLogs\" Global $LogFile = "TMP2_Hourly-4GCORE-Log-" & $InstanceNo & ".txt" Global $LogPathNFile = $LogDir & $LogFile WriteLog("[Info] Starting the ReRun Of " & $InstanceNo_Orig) ;Log the execution start ReRun_FileUpdateLog_Parallel($InputCSVFile) WriteLog("[Info] Done with ReRun Of " & $InstanceNo_Orig) ;Log the execution complete Exit Func ReRun_FileUpdateLog_Parallel($CSVFile) ; ; ; Do some processing here and return ; ; Return EndFunc
×
×
  • Create New...