![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-27 12:06 |
47,813 topics / 349,918 posts / today 0 new / 48,276 members |
| DOS批处理 & 脚本技术(批处理室) » [Perfect Solution] Regarding the Problem of Multi-threaded start && Command Connection |
| Printable Version 2,654 / 17 |
| Floor16 titiger | Posted 2007-09-05 22:44 |
| 初级用户 Posts 15 Credits 30 | |
|
I have seen it for a long time. After integrating the opinions from the upper floor, I finally tried to write it like this:
@echo off set a=100 :loop set /a a+=1 ::start cmd /c &echo %a% >>%a%.txt start cmd /c "ping -n 1 192.168.2.%a%&&echo 192.168.2.%a% >>ip.txt" if "%a%"=="105" exit goto :loop |
|
| Floor17 titiger | Posted 2007-09-05 23:52 |
| 初级用户 Posts 15 Credits 30 | |
|
However, problems still occur when using multithreading. For example, if two threads complete output at the same time, data loss will occur. I tried starting 200 threads, and as a result, 113 were successfully written and the rest were lost. How should this be solved?
|
|
| Floor18 bd123456789 | Posted 2008-03-12 17:21 |
| 中级用户 Posts 216 Credits 360 | |
|
start cmd /c & net send 10.20.8.214 "00">>11.txt
start cmd /c & net send 10.20.8.192 "00">>11.txt Why can only send the first one, and the second one is gone? Does it have to be PAUSE The purpose of the above program is that when using NET send to send, it will consume a lot of time when encountering a failure If it can be sent simultaneously, time can be saved! [ Last edited by bd123456789 on 2008-3-12 at 08:53 PM ] |
|
| Prev 1 2 |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |