Draw Control Flow Graph for the given code Highlight all regions in the flow graph separately Using cyclometic complexity formula, calculate number of basis path Show path of each basis path test

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 13RQ: How is an array stored in main memory? How is a linked list stored in main memory? What are their...
icon
Related questions
Question

SUBJECT: SOFTWARE ENGINEERING

Read the following code carefully and perform the following tasks:                 

  1. Draw Control Flow Graph for the given code
  2. Highlight all regions in the flow graph separately
  3. Using cyclometic complexity formula, calculate number of basis path
  4. Show path of each basis path test
#include <pthread. h>
#include <stdio.h>
int value
0;
void *runner (void *param);
/* the thread
* /
int main (int argc,
char *argv[])
{
int pid;
pthread.t tid;
pthread attr.t attr;
pid
fork ();
if (pid
pthread attr.init (&attr);
pthread.create (&tid, &attr,runner,NULL);
pthread.join(tid,NULL);
printf(" CHILD: value
}
else if (pid >
wait (NULL);
printf (" PARENT: value
}
0) {/* child process
* /
==
%d",value); /* LINE C */
0) {/* parent process
* /
%d", value); /*
LINE P
* /
void *runner (void *param) {
value =
5;
pthread exit (0);
Transcribed Image Text:#include <pthread. h> #include <stdio.h> int value 0; void *runner (void *param); /* the thread * / int main (int argc, char *argv[]) { int pid; pthread.t tid; pthread attr.t attr; pid fork (); if (pid pthread attr.init (&attr); pthread.create (&tid, &attr,runner,NULL); pthread.join(tid,NULL); printf(" CHILD: value } else if (pid > wait (NULL); printf (" PARENT: value } 0) {/* child process * / == %d",value); /* LINE C */ 0) {/* parent process * / %d", value); /* LINE P * / void *runner (void *param) { value = 5; pthread exit (0);
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Algebraic Expression
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning