Sponsored Content
Top Forums Shell Programming and Scripting Bash script multithread in group of 3 Post 302426123 by clx on Tuesday 1st of June 2010 12:58:48 AM
Old 06-01-2010
Do you mean to say executing each set of three simultaneously ? ( background) and wait for them to finish before executing next three?
if not so, they are anyway will be executed one by one. no matters set of three!!!

for first case, you can try something like,

Code:
#!/usr/bin/ksh

i=1
while [ $i -le 12 ]
do
 ./bang $i &
 ./bang $(( i+1 )) &
 ./bang $(( i+2 )) &
 wait 
 i=$(( i+3 ))
done

 

9 More Discussions You Might Find Interesting

1. Programming

Timeout with multithread server

I wrote a server which creates a thread for every client connection. I have to include timeout function that will kill the server thread if the client doesn't respond for specific time. That too using signal(SIGALRM). For this i am using alarm() function. When the server thread detects signal it... (1 Reply)
Discussion started by: Nads
1 Replies

2. Programming

Multithread,libcurl

Hi i m codding a programm,it can download any packet from ftp,I use libcurl library. But i want to use threads for downloading.(Multithreading).i cant get ftp file size from ftp and divide packet small pieces,like threads use. Please share your experince with me ,thanks. (0 Replies)
Discussion started by: canerbulut
0 Replies

3. Programming

Multithread app - Read-Only Data

Hello, I'm coding an application using pthreads.At some point the threads will read some read-only variables.Is it safe NOT to use mutexes, in order to make the program lighter since mutex operations are resource-demanding... Thanks (1 Reply)
Discussion started by: jonas.gabriel
1 Replies

4. Programming

[C] Multithread Server

Hi all,i'm new on this forum, excuse me for my english. I have wrote a server that accept connection from multiple client with the fork,but every client had to insert data in a linear list. The problem is that every client insert data in an own copy of the linear list and this is caused by... (7 Replies)
Discussion started by: kemistry
7 Replies

5. Shell Programming and Scripting

how to make your bash script run on a machine with csh and bash

hi, i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Discussion started by: npatwardhan
3 Replies

6. Solaris

How to find an application running on multithread?

Dear Friends, We have one T5240 server with 128vcpus in our lab.Performance of the server is very poor. Application uses only 2% of processor..I heard that single thread application performs slowly in coolthread.How can we find whether the application running on multithread or single thread? If... (7 Replies)
Discussion started by: nicktrix
7 Replies

7. Red Hat

Kcryptd - Which kernel supports MultiThread

I am currently have Centos 5.5 which consumes more CPU waiting for Kcrypt process. Later came to know that kcrypt is single threaded and hence consumes one CPU, results in performance degradation. Does any one really knows/practically experimented multithread of Kcryptd process with any of... (1 Reply)
Discussion started by: ragavendraganes
1 Replies

8. Shell Programming and Scripting

Sending email to group in bash

In shell scripting, TestEmail is an existing group email. I am using the below command to send emails who are existed under TestEmail . Unable to receive the email. I have tried group ="id1 id2 " .Its working and i tried creating alias as well. Can we do it without creating alias or group ="id1... (1 Reply)
Discussion started by: thomas9192
1 Replies

9. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
PICOLISP(1)							   User Commands						       PICOLISP(1)

NAME
pil, picolisp - a fast, lightweight Lisp interpreter SYNOPSIS
pil [arguments ...] [-] [arguments ...] [+] picolisp [arguments ...] [-] [arguments ...] [+] DESCRIPTION
PicoLisp is a Lisp interpreter with a small memory footprint, yet relatively high execution speed. It combines an elegant and powerful lan- guage with built-in database functionality. pil is the startup front-end for the interpreter. It takes care of starting the binary base system and loading a useful runtime environ- ment. picolisp is just the bare interpreter binary. It is usually called in stand-alone scripts, using the she-bang notation in the first line, passing the minimal environment in lib.l and loading additional files as needed: #!/usr/bin/picolisp /usr/lib/picolisp/lib.l (load "@ext.l" "myfiles/lib.l" "myfiles/foo.l") (do ... something ...) (bye) INVOCATION
PicoLisp has no pre-defined command line flags; applications are free to define their own. Any built-in or user-level Lisp function can be invoked from the command line by prefixing it with a hyphen. Examples for built-in functions useful in this context are version (print the version number) or bye (exit the interpreter). Therefore, a minimal call to print the version number and then immediately exit the inter- preter would be: $ pil -version -bye Any other argument (not starting with a hyphen) should be the name of a file to be loaded. If the first character of a path or file name is an at-mark, it will be substituted with the path to the installation directory. All arguments are evaluated from left to right, then an interactive read-eval-print loop is entered (with a colon as prompt). A single hyphen stops the evaluation of the rest of the command line, so that the remaining arguments may be processed under program con- trol. If the very last command line argument is a single plus character, debugging mode is switched on at interpreter startup, before evaluating any of the command line arguments. A minimal interactive session is started with: $ pil + Here you can access the reference manual : (doc) and the online documentation for most functions, : (doc 'vi) or directly inspect their sources: : (vi 'doc) The interpreter can be terminated with : (bye) or by typing Ctrl-D. FILES
Runtime files are maintained in the ~/.pil directory: ~/.pil/tmp/<pid>/ Process-local temporary directories ~/.pil/history The line editor's history file BUGS
PicoLisp doesn't try to protect you from every possible programming error ("You asked for it, you got it"). AUTHOR
Alexander Burger <abu@software-lab.de> RESOURCES
Home page: http://home.picolisp.com Download: http://www.software-lab.de/down.html PICOLISP(1)
All times are GMT -4. The time now is 07:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy