Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2021, 07:34
Masquerade's Avatar
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 731
Thanks: 160
Thanked 762 Times in 382 Posts
Masquerade is on a distinguished road
Multithreaded bat file

Hello everyone,

I have a bat file designed to carry out a task for all files in a folder via FOR command.

Currently, it only processes one file at once then moves onto the next file. For folders with, say, 200 items, this doesn't take long. However, it takes several hours to process large folders with several thousand items inside.

So, if I have 16 threads, is there any way to run the FOR task for 16 files at once all the way until all files are processed?
Reply With Quote
Sponsored Links
  #2  
Old 05-06-2021, 10:59
shazzla shazzla is offline
Registered User
 
Join Date: Nov 2010
Location: Hunnia
Posts: 222
Thanks: 408
Thanked 86 Times in 63 Posts
shazzla is on a distinguished road
Maybe this workaround can help you a bit ?! :

https://superuser.com/questions/1062...ter-batch-file

Somewhere i read, batch programming is very basic,cant do multithreading as you want.
Or im wrong?!
Reply With Quote
  #3  
Old 05-06-2021, 11:10
Prince4 Prince4 is offline
Registered User
 
Join Date: Mar 2015
Location: India->Delhi->Rohini
Posts: 119
Thanks: 100
Thanked 19 Times in 15 Posts
Prince4 is on a distinguished road
You can create a batch file for each folder and run them all at once. With "Call" or "Start" i guess.


Edit : What shazzla said.
__________________
Who's Got Time To Play Games? Huh??

Last edited by Prince4; 05-06-2021 at 11:11. Reason: What shazzla has linked is the same
Reply With Quote
  #4  
Old 05-06-2021, 11:20
Joe Forster/STA's Avatar
Joe Forster/STA Joe Forster/STA is offline
Senior forum member
 
Join Date: Nov 2000
Location: Hungary
Posts: 9,707
Thanks: 10
Thanked 297 Times in 188 Posts
Joe Forster/STA is on a distinguished road
This is the Unix bg command. It moves processes to the background - hence the name -, disconnecting their output from the console.

A more useful utility would be one that can launch command lines in the background. Try the built-in "start" command of Windows, with the options "/b" and "/min" and process priority, although it's not much. I use something like this when I want to compress multiple EXE's in the same directory with UPX.

None of these can synchronize the subprocesses, that is, make sure that exactly N subprocesses run at the same time and when one of them finishes, only then does the next one start.
__________________
Joe Forster/STA
For more information, see the FileForums forum rules and the PC Games forum FAQ!
Don't contact me via E-mail or PM to ask for help with anything other than patches (or software in general) done by me, otherwise your request may be deleted without any reply!
Homepage: http://sta.c64.org, E-mail: sta[email protected]; for attachments, send compressed (ZIP or RAR) files only, otherwise your E-mail will bounce back!
Reply With Quote
The Following 2 Users Say Thank You to Joe Forster/STA For This Useful Post:
GaMEr_2077 (06-06-2021), shazzla (05-06-2021)
  #5  
Old 07-06-2021, 04:54
panker1992's Avatar
panker1992 panker1992 is offline
Registered User
 
Join Date: Oct 2015
Location: Always Somewhere
Posts: 527
Thanks: 113
Thanked 752 Times in 294 Posts
panker1992 is on a distinguished road
i am using this for the past years and it works well

https://github.com/lordmulder/MParallel
__________________
My projects : Masked Compression, lzma2(xz) on Freearc, Zstd compressor for windows
My optimizations : packjpg.exe, zstd, lzham, precomp-dev-0.45.
Reply With Quote
The Following User Says Thank You to panker1992 For This Useful Post:
shazzla (07-06-2021)
  #6  
Old 07-06-2021, 07:58
Masquerade's Avatar
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 731
Thanks: 160
Thanked 762 Times in 382 Posts
Masquerade is on a distinguished road
Quote:
Originally Posted by panker1992 View Post
i am using this for the past years and it works well

https://github.com/lordmulder/MParallel
It first I was slightly confused by your reply, but after thinking it through I realised I can convert my for commands to echo into a list of commands for mparallel.

Thanks for the help, problem solved.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[CIUv3] Custom Installer Ultimate v3 KaktoR Conversion Tutorials 833 22-05-2022 12:07
SuperREP (SREP) Full Info! yasitha Conversion Tutorials 26 08-01-2019 18:49
PMA Update failure....????????? dannyk DVD Backup Forum 1 05-01-2005 14:19
cd burner help snatchcrash CD/DVD-Writers 1 14-09-2002 04:32
HELP ME PLZ!!!! Dalvin DC Games 0 02-01-2001 22:15



All times are GMT -7. The time now is 15:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Copyright 2000-2020, FileForums @ https://fileforums.com