Welcome to Coding : Sécurité Programmation Réseaux

Search   in  

 Create an Account Home | Submit News Your Account Content | Topics | Top 10  


Accueil
· Home
· Listing des Articles
· Top 10
· Repository des Exploits

Les sujets / parties
· C / C ++
· Visual Basic
· Asm
· Reseaux
· Java
· Securite
· Divers

Utile
· Listing des Articles

· Telecharger
· Le Forum
· Liens
· Proposer un article

Top20 des Downloads
· 1: Etude des reseaux generalites et protocoles
· 2: Cheval de troie en VB avec sources
· 3: Netcat 1.1
· 4: Keylogger
· 5: Etudes des reseaux hauts debits architectures et protocoles
· 6: Ecoute de port
· 7: Etude du Smart Spoofing
· 8: Win Packet Capture Utils
· 9: Tutorial on Traffic Interception on Switched Lan using ARP spoofing
· 10: Cours de C

User Info
Welcome, Anonymous
Nickname
Password
(Register)
Membership:
Latest: trapcodien
New Today: 1
New Yesterday: 0
Overall: 2207

People Online:
Visitors: 45
Members: 1
Total: 46

Online Now:
01: trapcodien

  
Coding : Sécurité Programmation Réseaux: Forums

Coding :: View topic - multiprocess bash script
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

multiprocess bash script

 
Post new topic   Reply to topic    Coding Forum Index -> Scripting
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Fri Jul 04, 2008 4:10 am    Post subject: multiprocess bash script Reply with quote

Hi there!

Sorry for the title ;-)

I want to let my script do some render jobs...
As I'm using multi-cpu and multi core machines, I thought to split up
the process to be rendered simultaneously...

So lets assume a machine with 4 Cores:
- I would start 4 processes named a, b, c, d
- inside each process I want to do the following
-- start another bash script (which does the rendering) and wait
until its finished to start the same script again, and again, etc.

How could I do something like that?

Thank you
Cheers
Johann
Back to top
pk
Guest





PostPosted: Fri Jul 04, 2008 4:10 am    Post subject: Re: multiprocess bash script Reply with quote

On Thursday 3 July 2008 18:57, horvat.johann@gmx.net wrote:

Quote:
Hi there!

Sorry for the title ;-)

I want to let my script do some render jobs...
As I'm using multi-cpu and multi core machines, I thought to split up
the process to be rendered simultaneously...

So lets assume a machine with 4 Cores:
- I would start 4 processes named a, b, c, d
- inside each process I want to do the following
-- start another bash script (which does the rendering) and wait
until its finished to start the same script again, and again, etc.

How could I do something like that?

I'm not sure I understand what you want. Note that generally you have no
control over which process gets executed on which cpu. On linux, you can
use taskset (schedutils) to get some control.

If you just want a script that launches a process, waits for it to finish,
launches it again, etc. just do this:

#!/bin/bash

while [ true ]; do
run_other_command
done

But I'm probably missing something.

--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.
Back to top
Chris F.A. Johnson
Guest





PostPosted: Fri Jul 04, 2008 8:10 am    Post subject: Re: multiprocess bash script Reply with quote

On 2008-07-03, horvat.johann@gmx.net wrote:
Quote:
Hi there!

Sorry for the title ;-)

I want to let my script do some render jobs...
As I'm using multi-cpu and multi core machines, I thought to split up
the process to be rendered simultaneously...

So lets assume a machine with 4 Cores:
- I would start 4 processes named a, b, c, d
- inside each process I want to do the following
-- start another bash script (which does the rendering) and wait
until its finished to start the same script again, and again, etc.

How could I do something like that?

Is this what you want?

while :; do a; done &
while :; do b; done &
while :; do c; done &
while :; do d; done &


--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Back to top
Dan Stromberg
Guest





PostPosted: Fri Jul 04, 2008 1:10 pm    Post subject: Re: multiprocess bash script Reply with quote

On Thu, 03 Jul 2008 09:57:03 -0700, horvat.johann wrote:

Quote:
Hi there!

Sorry for the title ;-)

I want to let my script do some render jobs... As I'm using multi-cpu
and multi core machines, I thought to split up the process to be
rendered simultaneously...

So lets assume a machine with 4 Cores: - I would start 4 processes named
a, b, c, d - inside each process I want to do the following
-- start another bash script (which does the rendering) and wait
until its finished to start the same script again, and again, etc.

How could I do something like that?

Thank you
Cheers
Johann

I may be misunderstanding, but it -sounds- like you want something like
this, that'll control your parallelism:

http://stromberg.dnsalias.org/~strombrg/loop.html

I hope to have a better implementation of the same idea available on the
web before long, but there are licensing constraints - this one's called
"looper".

Anyway, loop is better tested than looper at this point, so that's
probably the way to go for more than one reason.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Coding Forum Index -> Scripting All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.37 Seconds