Find Jobs
Hire Freelancers

C Programming, System programming, Process creation

$10-30 USD

Σε Εξέλιξη
Αναρτήθηκε περίπου 8 χρόνια πριν

$10-30 USD

Πληρωμή κατά την παράδοση
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.
Ταυτότητα εργασίας: 9647641

Σχετικά με την εργασία

3 προτάσεις
Απομακρυσμένη Εργασία
Ενεργός/ή 8 χρόνια πριν

Ψάχνεις τρόπο για να κερδίσεις μερικά χρήματα;

Πλεονεκτήματα πλειοδοσίας στο Freelancer

Καθόρισε τον προϋπολογισμό σου και το χρονοδιάγραμμα
Πληρώσου για τη δουλειά σου
Περίγραψε την πρόταση σου
Η εγγραφή και η πλειοδοσία σε εργασίες είναι δωρεάν
3 freelancers δίνουν μια μέση προσφορά $41 USD για αυτή τη δουλειά
Avatar Χρήστη
Hi, I am quite familiar and experienced in unix process programming using POSIC threads and can complete the assignment in 12 hours time. Please contact me as soon as possible if you need my help. With Regards, Koustav
$55 USD σε 1 ημέρα
4,9 (135 αξιολογήσεις)
6,1
6,1

Σχετικά με τον πελάτη

Σημαία της UNITED STATES
United States
0,0
0
Επαληθευμένη μέθοδος πληρωμής
Μέλος από Φεβ 14, 2016

Επαλήθευση Πελάτη

Άλλες δουλειές από αυτόν τον πελάτη

Many to one Thread Mapping in linuc using C language
$10-30 USD
Ευχαριστούμε! Σου έχουμε στείλει ένα email με ένα σύνδεσμο για να διεκδικήσεις τη δωρεάν πίστωση σου.
Κάτι πήγε στραβά κατά την προσπάθεια αποστολής του email σου. Παρακαλούμε δοκίμασε ξανά.
Εγγεγραμμένοι Χρήστες Συνολικές Αναρτημένες Δουλειές
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Φόρτωση προεπισκόπησης
Δόθηκε πρόσβαση για Geolocation.
Η σύνδεση σου έχει λήξει και τώρα έχεις αποσυνδεθεί. Παρακαλούμε συνδέσου ξανά.