how i write script to create 30 processes


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
# 1  
how i write script to create 30 processes

helo i make one process for com port . in that i create two thread one for reading data and another for writing data to com port.
now i want to write a script which create 30 processes for handling 30 com port.
is it good solution for handling 30 com port.
Thx & Regards,
Amit
# 2  
shell scripts let you create child processes, not threads. You can create threads using a compiled language like C.

Whether creating 60 processes is a good idea or not depends on a lot of factors, mostly available system resources.

Instead of telling us what you think you need to do, tell us what you are required to do

example: listen to 30 COM ports and write files based on their data streams.
# 3  
how i write a script to create 30 same

Sir,
i have 30 com ports which are connected with modems(each modem has rs-232 interface).
at server side i want to write application using c or c++ which monitors all 30 com ports and when data come on particular port , it reads it(data comming in form of packets).
so when packets come on particular port, process of that port extract the packet and send to another modem via another port.

so i m thinking to create one com process and after that using shell script i want to create 30 same com process.

for exaple for com port one CCU1 process. like i want to create seperate processes for each port.
functionality of each process is same read data from the com port and write data on the particular com port.
so how i write such script to create 30 com processes from one process.
Thanks and Regards,
Amit

QUOTE=jim mcnamara;302139125]shell scripts let you create child processes, not threads. You can create threads using a compiled language like C.

Whether creating 60 processes is a good idea or not depends on a lot of factors, mostly available system resources.

Instead of telling us what you think you need to do, tell us what you are required to do

example: listen to 30 COM ports and write files based on their data streams.[/QUOTE]
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #437
Difficulty: Medium
Vue.js is a free, proprietary JavaScript framework.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl script to create/write into spreadsheet

Hi, I need help in debug following script. can somebody help....!!! #!/usr/bin/perl -w use strict; use Spreadsheet::WriteExcel; # Create a new workbook called simple.xls and add a worksheet. my $workbook = Spreadsheet::WriteExcel->new('simple.xls'); my $worksheet =... (1 Reply)
Discussion started by: chettyravi
1 Replies

2. Homework & Coursework Questions

create a program that runs two processes linked oven

I need help program in C... :create a program that runs two processes linked oven (1 Reply)
Discussion started by: gizmo16
1 Replies

3. Shell Programming and Scripting

Create log for finished processes

Hi, I'm doing a script that generate some background process like for file in `find $dir -type f -maxdepth 1 -mtime -1`; do exp="java -cp process.jar testing $file &" eval $exp echo $! #Get the PID echo $(basename $file) >> log done Is there a way to know when those... (1 Reply)
Discussion started by: amondracorp
1 Replies

4. UNIX for Advanced & Expert Users

Multiple processes write to log file at the same time

If we have 3 process to write to same log file at the same time like below. will it cause the data outdated because the multiple process writing same time? It this a safe way to keep the log for multiple process? p1 >> test.log &; p2 >> test.log &; p3 >> test.log & Thanks, (1 Reply)
Discussion started by: casttree
1 Replies

5. UNIX for Dummies Questions & Answers

Create a shell script for write files with 2 parameters

Hello, I'm a newbie in shell script. So, i would like to create a shell script which take 2 IN parameters (PARAM1 and PARAM2). This script need to create 2 files as : I need to create this file /etc/apache2/sites-available/PARAM2 : <VirtualHost *:80> DocumentRoot "/home/PARAM1/www"... (0 Replies)
Discussion started by: chatlumo
0 Replies

6. Shell Programming and Scripting

To write a shell script which groups files with certain pattern, create a tar and zip

Hi Guru's, I have to write a shell script which groups file names based upon the certain matching string pattern, then creates the Tar file for that particular group of files and then zips the Tar file created for the respective group of files. For example, In the given directory these files... (3 Replies)
Discussion started by: rahu_sg
3 Replies

7. UNIX for Dummies Questions & Answers

how to write script to create directory

Please help. I am the beginner. Don't understand about archive file. How to create a directory for the files from each archive with name of directory which equivalent to the base name of the archive. eg I have file abc.txt. How can I create a directory name abc. Thank you (1 Reply)
Discussion started by: snail
1 Replies

8. Shell Programming and Scripting

Processes create/join

I'm working with some code in php that creates a process and I want the main program to wait till that process is done running then come back and join. <code> $pid = pcntl_fork(); if ($pid == -1){ die('could not fork'); } else if ($pid){ pcntl_wait($status); } else{ echo... (1 Reply)
Discussion started by: airon23bball
1 Replies

9. Programming

programatic ways to create background processes in C/C++

How can we create a background process programmatically? One way I know of is to fork() and exit from the parent process, leaving the child running. It will run as a background process. I would like to know if there are any other ways. In perticular how are daemon processes created? (1 Reply)
Discussion started by: ipzig
1 Replies

10. Programming

Read/write locks within and between processes. Can you help?

I have an application that is multithreaded and concurrent. Multiple instances of the application must run at the same time. Each thread in each process accesses shared resources. For this purpose I've employed Butenhof's read-write locks. Inter-process locking is based on fcntl. For example,... (3 Replies)
Discussion started by: adamb
3 Replies

Featured Tech Videos