Find Jobs
Hire Freelancers

C Programming - Probabilistic Simulation of a Client-Server system

$10-30 CAD

In Progress
Posted almost 3 years ago

$10-30 CAD

Paid on delivery
Write a program that does a probabilistic simulation of a client server system. The clients generate job packages at random times and place them on the global queue. Every package takes a random amount of time to execute and if the servers are busy the package stays on the queue. At every time interval a the client and the server are woken up to simulate work done during this interval. The servers need one parameter, the completion rate μ (mu), also called death rate, of the currently executing process. At every activation of the server, if there is a job executing, the server generates a random number between zero and one and compares it to μ. If the random number is smaller than μ the job execution is terminated. If there is no job executing, the server gets a job from the global queue if available. The state of the server can be either busy or not-busy. The clients need one parameter as well, the birth rate l (lambda) of the jobs. Again, at every activation (if it is not waiting for a previous job to complete) the client generates a random number between zero and one and compares it to l . If the random number is smaller than l a new job is generated and placed on the global queue. The program has to have a simple queue (really simple, it just keeps track of the number of items in it and nothing else since all the jobs are really the same). It also needs to keep a few statistics (like number of jobs generated, total number of jobs in the queue, number of clock ticks so far, etc) from which to compute useful statistics. 1 The program prints the following job statistics, one per line, properly annotated: (1) Average waiting time (AWT) (2) Average execution time (AXT) (3) Average turnaround time (ATA) (4) Average queue length (AQL) (5) Average interarrival time. (AIA) The command line options to the program are the --lambda [0.005], --mu [0.01], --servers[2], --clients[2], --ticks[1000]. Your program will use pthreads. Every server, and every client will be separate threads. In addition there is one thread for the clock and this can be the original thread. At every tick of the clock thread, all other threads get activated, do whatever they need to do and then wait for the next tick. Whenever the clock sees that all the threads have completed their work for the current tick, it emits the next tick. The program runs for the number of ticks specified
Project ID: 30645791

About the project

3 proposals
Remote project
Active 3 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
EXPERT IN NAMED SKILLS, OVER 18 YEARS OF EXPERIENCE, DEAR EMPLOYER, After KEENLY reading your description and being in possession of all CLEARLY STATED REQUIRED SKILLS as this is my area of PROFESSIONAL SPECIALIZATION having the above QUALIFICATIONS, i hereby humbly request you to consider my bid for QUALITY and PROFESSIONAL work. THANK-YOU.
$30 CAD in 1 day
0.0 (0 reviews)
0.0
0.0
3 freelancers are bidding on average $69 CAD for this job
User Avatar
Thanks for your project. I have 30 years experience programming in C. I will create this simulation using pthreads as described in the attachment. A milestone payment for the full budget for this project must be deposited with this site before your offer can be accepted. Alan Idler Chief Software Architect Idleswell Software Creations
$158 CAD in 7 days
4.8 (64 reviews)
5.0
5.0
User Avatar
--------------------------------------- Hello! I have checked the project description and I think that I can help you to do this project. I am fully feeling comfortable working with C++, Algorithm Hope to discuss further details via chat. Thanks. Aleksandr.
$20 CAD in 7 days
5.0 (1 review)
1.7
1.7

About the client

Flag of CANADA
Brampton, Canada
0.0
0
Payment method verified
Member since Jun 24, 2021

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.