Click here to Skip to main content
15,891,657 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: regarding http status code Pin
Marc Firth26-Mar-09 2:01
Marc Firth26-Mar-09 2:01 
GeneralRe: regarding http status code Pin
random426-Mar-09 3:59
random426-Mar-09 3:59 
GeneralRe: regarding http status code Pin
Marc Firth26-Mar-09 5:01
Marc Firth26-Mar-09 5:01 
GeneralRe: regarding http status code Pin
random426-Mar-09 22:41
random426-Mar-09 22:41 
GeneralRe: regarding http status code Pin
random427-Mar-09 22:50
random427-Mar-09 22:50 
GeneralRe: regarding http status code Pin
Marc Firth29-Mar-09 23:37
Marc Firth29-Mar-09 23:37 
AnswerRe: regarding http status code Pin
fly90426-Mar-09 2:45
fly90426-Mar-09 2:45 
QuestionA better explanation on pipes, parents, and childs and tips to code Pin
Endomlic22-Mar-09 15:51
Endomlic22-Mar-09 15:51 
I was given a HW assignment that I am having a lot of trouble on.
I must have missed the day the teacher explained all of this because I have nothing on this material other than google...It's not even in the text.

here is the problem

Write a C-program that does the following:
The program first creates a single pipe, using the pipe() system call. It then forks a child process
using the fork() call. The goal is to share the work of counting numbers that are multiples of 3
and 5 from the set of integers from 1-10000. The parent process executes the for-loop (from
1-10000) and takes the responsibility for counting all multiples of 5. All numbers that are not
multiple of 5 are passed through the pipe to the child process to be inspected and counted if they
are multiples of 3. Note: Only the parent process will implement the for-loop from 1-10000. After
the processes have completed their work, both, parent and child will print out a corresponding
message together with their corresponding process-id. The child then uses the pipe to send its
result to the parent. Upon reading the number of multiples of 3 from the pipe, the parent will print
out the complete response to the user (i.e., count of multiples of 3 and 5) and wait for the child to
exit properly and exit.
What happens if the child process is executing significantly slower than the parent process, i.e.,
what if the parent wants to read from the pipe while the child process has not had a chance to read
all multiples of 3 from it? Describe the problem! Describe how you simulated this problem!
What do you need to do to avoid this problem? Show your solution!

could anyone give me any ideas on how to go about solving this, and how I'm supposed to work with communicating these pipes?
QuestionExplain this regex. Pin
jschell22-Mar-09 9:15
jschell22-Mar-09 9:15 
AnswerRe: Explain this regex. Pin
Garth J Lancaster22-Mar-09 11:42
professionalGarth J Lancaster22-Mar-09 11:42 
GeneralRe: Explain this regex. Pin
jschell26-Mar-09 10:23
jschell26-Mar-09 10:23 
AnswerRe: Explain this regex. Pin
JimmyRopes12-May-09 12:28
professionalJimmyRopes12-May-09 12:28 
GeneralRe: Explain this regex. Pin
jschell19-May-09 8:00
jschell19-May-09 8:00 
QuestionPerl and Regular Expressions Pin
BobInNJ21-Mar-09 12:16
BobInNJ21-Mar-09 12:16 
AnswerRe: Perl and Regular Expressions Pin
Garth J Lancaster22-Mar-09 0:11
professionalGarth J Lancaster22-Mar-09 0:11 
AnswerRe: Perl and Regular Expressions Pin
Member 38111902-Sep-09 1:11
Member 38111902-Sep-09 1:11 
Questioncan php make os like java Pin
RAJudev8920-Mar-09 8:14
RAJudev8920-Mar-09 8:14 
AnswerRe: can php make os like java Pin
Mohammad Dayyan20-Mar-09 17:53
Mohammad Dayyan20-Mar-09 17:53 
AnswerRe: can php make os like java Pin
phparray23-Mar-09 3:46
phparray23-Mar-09 3:46 
AnswerRe: can php make os like java Pin
Marc Firth24-Mar-09 23:17
Marc Firth24-Mar-09 23:17 
AnswerRe: can php make os like java Pin
Luc Pattyn26-Mar-09 2:45
sitebuilderLuc Pattyn26-Mar-09 2:45 
Questionphp website Pin
Pratyush Dubey17-Mar-09 3:21
Pratyush Dubey17-Mar-09 3:21 
AnswerRe: php website Pin
EliottA17-Mar-09 10:14
EliottA17-Mar-09 10:14 
RantRe: php website Pin
random426-Mar-09 0:48
random426-Mar-09 0:48 
GeneralRe: php website Pin
EliottA26-Mar-09 2:24
EliottA26-Mar-09 2:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.