Looking for a similar answer, essay, or assessment help services?

Simply fill out the order form with your paper’s instructions in a few easy steps. This quick process ensures you’ll be matched with an expert writer who
Can meet your papers' specific grading rubric needs. Find the best write my essay assistance for your assignments- Affordable, plagiarism-free, and on time!

Posted: December 20th, 2019

Creating process tree using C ( 3 small problems)

Question description

Problem 1.
Develop a
program named ProcessTree.c. When the program is
run, it accepts
four command
line arguments, denoted as h, m, s and d respectively.
The program
should create mulitple processes form a binary tree of height
h. Let us identify these processes using integers 0, 1, · · · , 2h+1
−2 such that: (i)
the process
on the root is identified as 0; (ii) if the process identified as y is a
child of the
process identified as x, then y = 2x + 1 (left child) or y = 2x + 2
(right
child). Among these processes, two can communicate with each other iff
they are
parent and child. You are required to use system calls fork and pipe
for process
creation and inter-process communication.
Then, given
that arguments m is a string while s and d are integers from
{0, · · ·, 2h+1 − 2}, the process identified by s should send string m to the process
identified by
d via one or multiple pipes
connecting the processes. During
the course
that string m is being sent, forwarded and
received, every involved
process
should output its identify.
Problem 2.
Develop a
program named ProcessForest.c. As in Problem 1,
when the program
is run, it
accepts four command line arguments, denoted as h, m, s and
d.
The program
should create two binary trees of processes where each process
is identified
by a pair (treeID, processID), where treeID is either 0 or 1, and
within each
tree, the processID of each process is
determined in the same way
as in Problem
1. Among these processes, each pair of processes that are parent
and child on
a tree can communicate with each other via pipe, and the two root
nodes can
communicate with each other through a shared memory block (Note:
1
you should
use the POSIX shared memory library to create and manage the
block).
The argument m is a string, s and d are two pairs s = (s0, s1) and d = (d0, d1)
where s0 and d0 are selected from {0, 1} while s1 and d1 are selected from
{0, · · ·, 2h+1 − 2}. The process identified by s should send string m to the
process
identified by d hop by hop. During the course
that the string m is being
sent,
forwarded and received, every involved process should output its identity.
Problem 3.
Develop a
program name T hreadMapper.c. The program will
be compiled together
with
(user-providing) functions named func1, func2 and func3, each of
which has the
signature of int func() and may call a
function named void yield()
whose
functionality is to be explained later. The functionality of ThreadMapper
is as
follows:
• First, for each of the functions func1, func2 and func3, a user thread
that can run
the function is created by initializing a context for the user
thread.
• Second, store these contexts into a queue.
• Third, adopt the many-to-one mode to execute the user threads according
to their
orders in the queue. When a running user thread calls yield(), it
should be
unmapped from the kernel thread; its context should be saved
and appended
to the tail of queue, waiting for the next turn that it will
be executed again.

Tags: Ace-myhomework Assignment, Affordable College Homework, APA Citation Assignment Help, Custom Essay Writing

Order|Paper Discounts

Why Choose Essay Bishops?

You Want The Best Grades and That’s What We Deliver

Top Essay Writers

Our top essay writers are handpicked for their degree qualification, talent and freelance know-how. Each one brings deep expertise in their chosen subjects and a solid track record in academic writing.

Affordable Prices

We offer the lowest possible pricing for each research paper while still providing the best writers;no compromise on quality. Our costs are fair and reasonable to college students compared to other custom writing services.

100% Plagiarism-Free

You’ll never get a paper from us with plagiarism or that robotic AI feel. We carefully research, write, cite and check every final draft before sending it your way.