简体   繁体   中英

Starting a executable from multiple threads through Process.Start()

I am using "7z.exe" to do some extra work in my application(c#).I have embedded "7z.exe" in the main executable of my application as a resource file. During execution of my application i extract "7z.exe" on a hard-disk and execute it through Process.Start().

I need to execute "7z.exe" multiple times and from multiple threads. Is it safe to access same "7z.exe" file from multiple threads? or should i extract separate "7z.exe" (to different location on hard-disk) for each process.Start()

PS:7z.exe belongs to Seven-zip software which is written in c/c++.

Yes, you should be able to start multiple processes from the same executable file - assuming the process doesn't do anything itself to prevent that (which is feasible - you'd have to check for 7-zip). Can you definitely not do what you want using a zip library such as SharpZipLib ?

是的,从不同的进程/线程执行相同的exe文件是安全的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM