Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Handling jobs with same macro, queuing
#12
Quote:Anyway, it does not explain why the different calls give different result in the command line exe...
It still happens now? Maybe the command line program does not support multiple instances of its process. Then add lock near the beginning of the shell-menu-triggered function.

Code:
Copy      Help
function $files
lock ;;other thread will wait here until previous thread ends. It is a simple way to make threads run in a queue, not simultaneously. Actually it's not a true queue, eg if launched thread 1, 2 and 3, may run 1, 3 and 2.
foreach f files
,FCleanthefile(f)

Quote:Can you in few words explain what converting to a function did the job, would help to understand.
When it was macro, it did not run if previous instance of the macro was still running. Now two threads of the function run simultaneously in this case; and two processes of the command line program launched, unless there is lock .


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)