10 More Discussions You Might Find Interesting
1. Programming
I understand that fork create a child but I need very simple example that make child useful....
I mean how will make the program faster anyone explain with code plz
using C plz (2 Replies)
Discussion started by: fwrlfo
2 Replies
2. UNIX for Dummies Questions & Answers
I'm trying to run a simple test on how to use fork(), i'm able to execute the child process first then the parent, but how can I execute parent then child..?
Thanks! (1 Reply)
Discussion started by: l flipboi l
1 Replies
3. Programming
does fork() spawn only the parent process, what if fork() is looped, does it spawn the parent and the child? (4 Replies)
Discussion started by: Peevish
4 Replies
4. Programming
Hi,
I wrote a simple program for understanding the fork command. The code is as below
int main(void)
{
fork(); printf("hi 1 \n");
fork(); printf("hi 2 \n");
fork(); printf("hi 3 \n");
}
I am getting a variation in the number of times the printf is called if i remove the \n from each... (2 Replies)
Discussion started by: xyz123456
2 Replies
5. UNIX for Advanced & Expert Users
Hi,
I wrote a simple program for understanding the fork command. The code is as below
int main(void)
{
fork(); printf("hi 1 \n");
fork(); printf("hi 2 \n");
fork(); printf("hi 3 \n");
}
I am getting a variation in the number of times the printf is called if i remove the \n from each of... (1 Reply)
Discussion started by: xyz123456
1 Replies
6. Programming
hi all
About this code
for (i = 1; i < n; i++)
if ((childpid = fork()) <= 0)
break;
I really can't understand the output .
and the way fork () return the value .
how about the process Id ,the child process Id and the parent ID
in this case
so please answer me soon (5 Replies)
Discussion started by: iwbasts
5 Replies
7. Programming
Hello all.
I'm developing a filetransfer application, which is supposed to work sort of like dcc, with multiple transfers etc. Now i wonder what the best way to manage the transfers is. Should i fork() for each new transfer, hogging loads of memory or use pthreads? Maybe I can use select to see... (0 Replies)
Discussion started by: crippe
0 Replies
8. Programming
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#define MAX_COUNT 200
#define BUF_SIZE 100
void main(void)
{
pid_t pid;
int i;
char buf;
fork();
pid = getpid();
for (i = 1; i <= MAX_COUNT; i++) {
sprintf(buf,... (2 Replies)
Discussion started by: MKSRaja
2 Replies
9. Programming
I run this code, actually I want to both processes print the message from "data". But only one does. What happens? Anyone can help?
#include <stdio.h>
main(){
int fd, pid;
char x;
fd = open("data",0); /* open file "data" */
pid = fork();
if(pid != 0){
wait(0);
... (2 Replies)
Discussion started by: Herman
2 Replies
10. UNIX for Dummies Questions & Answers
What is a fork? Why would one create a fork? What are the advantages and disadvantages of using a fork?
Please advise.
Thank You.
Deepali (5 Replies)
Discussion started by: Deepali
5 Replies
GIT-CHERRY(1) Git Manual GIT-CHERRY(1)
NAME
git-cherry - Find commits not merged upstream
SYNOPSIS
git cherry [-v] [<upstream> [<head> [<limit>]]]
DESCRIPTION
The changeset (or "diff") of each commit between the fork-point and <head> is compared against each commit between the fork-point and
<upstream>. The commits are compared with their patch id, obtained from the git patch-id program.
Every commit that doesn't exist in the <upstream> branch has its id (sha1) reported, prefixed by a symbol. The ones that have equivalent
change already in the <upstream> branch are prefixed with a minus (-) sign, and those that only exist in the <head> branch are prefixed
with a plus (+) symbol:
__*__*__*__*__> <upstream>
/
fork-point
\__+__+__-__+__+__-__+__> <head>
If a <limit> has been given then the commits along the <head> branch up to and including <limit> are not reported:
__*__*__*__*__> <upstream>
/
fork-point
\__*__*__<limit>__-__+__> <head>
Because git cherry compares the changeset rather than the commit id (sha1), you can use git cherry to find out if a commit you made locally
has been applied <upstream> under a different commit id. For example, this will happen if you're feeding patches <upstream> via email
rather than pushing or pulling commits directly.
OPTIONS
-v
Verbose.
<upstream>
Upstream branch to compare against. Defaults to the first tracked remote branch, if available.
<head>
Working branch; defaults to HEAD.
<limit>
Do not report commits up to (and including) limit.
SEE ALSO
git-patch-id(1)
GIT
Part of the git(1) suite
Git 1.7.10.4 11/24/2012 GIT-CHERRY(1)