The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
running servers parallel soliberus IP Networking 1 06-03-2008 08:45 AM
Running scripts in parallel nivas Shell Programming and Scripting 6 02-21-2008 05:44 AM
In C Program, determine if job is running BCarlson High Level Programming 12 07-16-2006 01:05 PM
running a program for a specified time prosputko High Level Programming 3 07-06-2005 02:39 PM
Running a program perleo UNIX for Dummies Questions & Answers 3 08-23-2002 11:34 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-18-2006
bankpro bankpro is offline
Registered User
  
 

Join Date: Jan 2006
Location: Mumbai
Posts: 43
running a parallel program

hi ,


i need to run a parallel program .


for example;

program1

{
array[]=" the second program should called here : program 2"

the execution should continue

}


the 2nd program should recieve an array of information as argument and it should process parallel with program 1.
  #2 (permalink)  
Old 01-18-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,953
Quote:
Originally Posted by bankpro
hi ,


i need to run a parallel program .


for example;

program1

{
array[]=" the second program should called here : program 2"

the execution should continue

}


the 2nd program should recieve an array of information as argument and it should process parallel with program 1.

parallel execution - in a single processor system it is only pseudo parallelism that can be guaranteed and not the concurrent execution (concurreny is just a perception)

I dont find anything difficult or setback in making use of fork to split functionalities and proceed thereby
  #3 (permalink)  
Old 01-18-2006
bankpro bankpro is offline
Registered User
  
 

Join Date: Jan 2006
Location: Mumbai
Posts: 43
I don't want the control to return back to the parent process. The child process should execute parallely with parent process.

According to fork definition, a child process is created which is the duplicate of parent process's program space. so, i don't think so fork will solve this problem
  #4 (permalink)  
Old 01-18-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
I don't think that you are getting what matrixmadhan is trying to say here. When you fork, you can actually carry out two different tasks. One in the child and one in the parent.
The tasks will execute concurrently. If you have multiple processors, the processes may execute on different processors.
  #5 (permalink)  
Old 01-20-2006
linuxpenguin's Avatar
linuxpenguin linuxpenguin is offline Forum Advisor  
Registered User
  
 

Join Date: May 2002
Location: India
Posts: 295
<array[]=" the second program should called here : program 2">

what are you expecting here, should the second program return you multiple values, to fill the array ?

thats is not possible in a c program.
regarding concurrent processing ( or pseudo concurrency ) you can use fork for sure.

and programming for parallel processing on a system having multiple processor would be interesting tho. Do let me know if you find out how you can force your process to run on a particular processor. for eg, parent running on processor 1 and child on 2.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:03 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0