11-17-2011
need help in forking
I have an input file with contents like:
5785690|68690|898809
7960789|89709|789789
7669900|87865|659708
7869098|65769|347658
so on..
I need to pass this file to 10 parallely running processes (forking)so that each line is processed by a process and no line is processed twice and write the output to a single output file with out ant collision between processes.
Can any one help me out in this:-(
10 More Discussions You Might Find Interesting
1. Programming
When I compile this C programme I get different outputs each time I run it
Please explain to me whats happening in the code if you can give me a detailed explanation. Because I am stuck with this.
#include <stdio.h>
main(){
int i = 0;
printf("I am the... (1 Reply)
Discussion started by: manjuWicky
1 Replies
2. UNIX for Advanced & Expert Users
When I compile this C programme I get different outputs each time I run it
Please explain to me whats happening in the code if you can give me a detailed explanation with the schedular functionality it will help a lot. Because I am stuck with this.
#include <stdio.h>
main(){... (3 Replies)
Discussion started by: manjuWicky
3 Replies
3. Programming
Hi
I'm currently working with C on UNIX (HPUX) and need to be able to fork a seperate Java process from within a running C process.
I can run the following code from the command line via a script but am having difficulty getting it to work from within the code.
I am trying to use execl. Is... (4 Replies)
Discussion started by: themezzaman
4 Replies
4. Programming
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
pid_t pID;
int i;
for (i = 0; i < 3; i++)
{
pID = fork ();
if (pID == 0)
{
printf ("Value of i --> %d... (2 Replies)
Discussion started by: kymthasneem
2 Replies
5. Programming
Is it safe to call fork+exec in a multithreaded application.
Because In my multithreaded application, I need to execute another program in each thread.
I am using solaris 10.
Any suggestions pls. (2 Replies)
Discussion started by: axes
2 Replies
6. Shell Programming and Scripting
Hello,
I am new to this site, so sorry ahead of time if this is not the right place for this question.......anywhooooo
I am having troubles with forking new processes in wish. Take the following code example:
****************************
package require Tclx
puts "TCL VER: "
proc... (3 Replies)
Discussion started by: pghamami
3 Replies
7. Programming
i wanna ask about forking in unix...how can you do forking...??i don't understand and i have an assignment about it...the output should look like this...
Question 1 : what's your name ?
Answer : if no answer, write to file...----Out of time-----because for each question it is given a... (3 Replies)
Discussion started by: kkk02
3 Replies
8. Shell Programming and Scripting
Hi,
my $log = IO::File->new(">$log_file_name");
$log->print("date()."--\n\n\n");
sub process {
my ($sub_dir, $file, $config, $log) = @_;
$log->print("-- Reading $file file\n");
}
my $pm = new Parallel::ForkManager($tc+1);
$pm->run_on_finish( sub { my ($pid, $exit_code,... (1 Reply)
Discussion started by: sandy1028
1 Replies
9. Shell Programming and Scripting
Keep in mind that I haven't done Perl scripting for a LONG time, so I'm quite rusty.
This is what I would like to do:
- using fork, create 3 or 4 processes to read 3 or 4 different text documents containing server names or IP addresses
- in each of those processes, Perl will ping each of those... (7 Replies)
Discussion started by: kooshi
7 Replies
10. Programming
My question is, how do you fork only the parent processes in unix? For example how would I use the fork function to fork the parent process more than once and leave the children processes alone. This way I do not have children of children. The way I have it set up now it the parent process forks 3... (7 Replies)
Discussion started by: TWhitt24
7 Replies
LEARN ABOUT DEBIAN
autolog
AUTOLOG(8) System Manager's Manual AUTOLOG(8)
NAME
autolog - Log out idle users
SYNOPSIS
autolog [ options ]
DESCRIPTION
The program reads the utmp file, entry by entry. The username for each 'user process' is compared to the entries in the configuration file
(see autolog.conf(5) ). The first entry to match both the name, the group, and the tty line of the process will be used to conduct the
automatic logout.
CALL
/etc/init.d/autolog start
or
autolog
to run this program in daemon-mode
autolog -o
to run this program as "ordinary" program. Keep in mind: Also when running as ordinary program, it will stay in memory until all
its jobs are done.
OPTIONS
-a (all processes) Print information on ALL utmp entries--not just user processes.
-d (debug mode) This is helpful in setting up your configuration file. The program runs in foreground rather than forking and it
prints out verbose messages about what it is doing.
-n (nokill) Use this to prevent autolog from actually "killing" anyone. Use -d and -n together when setting up a new configuration
file. ( This will not affect killing of lost processes. )
-o (ordinary) Use this to run this program as ordinary program, not as daemon. Program will end, when its job is done. In this case,
some data is kept in "/var/lib/autolog/autolog.data". This is read, when the program is called again.
-f config_file_name
Use this to override the default: "/etc/autolog.conf"
-l log_file_name
Use this to override the default: "/var/log/autolog.log". Note that if this file doesn't exist, no logging will happen. Create the
file (with touch) to enable logging.
-t idle_time
Use this to override the internal default idle time (minutes)
-g grace_period
Use this to override the internal default grace period (seconds)
-m yes/no
Use this to override the internal mailing switch. If "yes" the program will send mail to the users right after killing them.
-c yes/no
Use this to override the internal "pre-clear" switch. If "yes" the program will clear the terminal screen before warning the user.
-w yes/no
Do timeouts based on total session time--not idle time. (hard)
-l yes/no
If set to "yes" activities will be written to the logfile if present.
AUTHOR
Kyle Bateman <kyle@actarg.com> (autolog 0.35),
Carsten Juerges <juerges@cip-bau.uni-hannover.de>
(autolog 0.40)
This manual page was modified for Debian by Paul Telford <pxt@debian.org>
Linux Administrative Utilities AUTOLOG(8)