[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: thread issue



On Thu, 04 Aug 2011 10:59:58 -0500, Stan Hoeppner wrote:

> On 8/4/2011 10:34 AM, Walter Hurry wrote:
>> On Thu, 04 Aug 2011 16:28:41 +0100, Darac Marjal wrote:
>> 
>>> On Thu, Aug 04, 2011 at 10:23:08PM +0800, lina wrote:
>>>> Thanks for suggestions,
>>>>
>>>> Actually I got a job which contains several small jobs inside.
>>>>
>>>> if run the bash script, it will do those one by one and it is pretty
>>>> slow, waiting ...
>>>>
>>>> I can run each small jobs separately, but use a bash script kind of
>>>> easy to make some changes in amount and manage.
>>>>
>>>> I just wonder are there some simple way to do it?
>>>
>>> What you could try is converting your bash script to a makefile, you
>>> can then let make do the work of parallelizing your jobs with "make -j
>>> 8 -f yourmakefile".
>> 
>> That's a clever use of make. Wish I'd thought of that!
> 
> Simply backgrounding the processes in the existing shell script is
> easier.  Using the make file option is simply extra work with no gain. I
> do know of other cases where the make file option is better.  Just not
> this case.

OK, fair point.

Nevertheless, I must try to remember that make is for lists of 
interdependent tasks, not just for compiling programs and so forth. 
Darac's suggestion (as far as I am concerned) is a good example of 
lateral thinking, even if it may not be the optimal solution in this 
particular case.



Reply to: