多进程任务管理示例 Autohotkey

本文来自于Thinkai’s Blog,thinkai也是我在ahk上面的引路人,对thinkai感兴趣的朋友请关注他的博客。

thinkai的博客简洁、有趣,即便是转载过来我也尽量保持作者原有的风格,主要是方便大家查阅。

exe_file := "test.exe"
Gui, Add, text, x0 y0 w60 h20, 源文件
Gui, Add, Edit, x60 y0 w200 h20 vsource_file
Gui, Add, text, x0 y20 w60 h20, 进程数
Gui, Add, Edit, x60 y20 w200 h20 vmax, 10
Gui, Add, Button, x0 y40 w160 h20 gstart vstart, 开始
gui, Add, text, x0 y60 w160 h100 vshow
Gui, Show, x0 y0, 多进程示例
return
 
start:
GuiControl, Disable, start
Gui, Submit, nohide
FileRead, content, % source_file
Loop, Parse, content, `n, `r
{
    while(!check_idle())
        Sleep, 1000
    info := StrSplit(res,",")
    GuiControl, , show, % "信息:" info[1] " " info[2] "`n本次运行数量:" A_index "`n当前线程数:" p.maxindex()+1
    Run, %  exe_file " " info[1] " " info[2], , , pid ;传参方式传递数据
    p.Push(pid)
}
return
 
GuiClose:
ExitApp
 
check_idle(){
    global p,max
    for k,v in p
    {
        Process, Exist, % v
        if !ErrorLevel
            p.RemoveAt(k)
    }
    return (p.maxindex()<max)
}

 

给TA捐赠
共{{data.count}}人
人已捐赠
其他教程

多sheet数据插入sql server一个表 Autohotkey

2020-2-20 8:30:22

其他教程案例

WinHttpRequest POST XML数据示例 Autohotkey

2020-2-20 8:32:45

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
有新私信 私信列表
搜索