WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
wait for resources looping (Read 2341 times)
kenwshmt
YaBB Newbies
*
Offline



Posts: 11
wait for resources looping
Aug 3rd, 2005 at 7:27am
 
I am using version 3.2, as 4 doesn't have the 'don't wait for close'

I have it set to launch several instances of the batch, but it will often launch so many that the system will run out of resources and stall until the others finish.

I am thinking of incorporating a wait loop.

this is what ive thought of, but havnt implemented yet.

batch starts-
if counter file 4 exists, rename to counter 5
if counter file 3 exists, rename to counter 4
if counter file 2 exists, rename to counter 3
if counter file 1 exists, rename to counter 2

call busyloop

normal batch
goto :end

:busyloop
if not exist counter 5 goto EOF
goto :busyloop

:end
if counter file 2 exists, rename to counter 1
if counter file 3 exists, rename to counter 2
if counter file 4 exists, rename to counter 3
if counter file 5 exists, rename to counter 4

--

i think the batches perform ok when about 5 are running, the rest can be going in the loops until resources recover some.

Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: wait for resources looping
Reply #1 - Aug 3rd, 2005 at 7:43am
 
Not a good idea to implement a busy-loop like that, how about this one:

:busyloop
rem sleep 3 seconds without consuming cpu
"%WD_INSTDIR%\gdputil.exe" -sleep 3
etcetera

gdputil is described here: http://www.watchdirectory.net/watchDir/GdPUtil.html.

Your "rename thing" will also be a problem when multiple .bat's are renaming at the same time.

I seem to have misplaced my thinking cap, but maybe you can use the "-join" described on the above gdputil page.

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: wait for resources looping
Reply #2 - Aug 3rd, 2005 at 3:50pm
 
This is, obviously, completely coincidential, but "Do not wait for .bat file to exit" and "allow ? .bat files max to run at the same time" have been implemented in version 4.

http://www.watchdirectory.net/wdhelp/help/wdcc_version_history.html
http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBat.html

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Page Index Toggle Pages: 1