Suoritettu

I need a C Programmer

Operating Systems: C PROGRAM (single standard .c file):

I need to use the concept of POSIX threads, semaphores and mutex locks.

Consider a very small bank: XYZ. This bank has only one cashier (aka bank teller or customer representative) and a small waiting room for any incoming customers while the cashier is busy with other customer. There is a sofa which can only hold 5 people at maximum. The cashier can only serve one customer at any time. When the cashier is serving one customer, other customers have to wait in the sofa. If there are already 5 people waiting for their turn and the sixth person comes to the bank, then he/she just leaves the bank. Before the customer is being served, the customer needs to enter the account number and each customer will be serviced on first come first served basis.

Use separate Pthreads to create N customers and cashier. Each of these customers as well as the cashier should run as a separate thread. When the customer is being serviced, print the message clearly saying that the customer with account number is being serviced. Assume each customer is done in 5 seconds. You also need to display the waiting list when the customers comes in and when the customer is serviced. You need to display if any customer leaves the bank without getting service (due to the limit of 5 people already waiting). If there is no customer at any time, the cashier just waits for the arrival of customer.

GENERAL IDEA:

Basically you take an argument from the command line for number of threads = n.

Make an global array of int[5] for the FIFO queue.

Create a cashier thread.

Then in a loop with an arbitrary delay (you can spawn threads) create n customer threads each with a unique id.

The customer threads attempt to get on the queue, if its full they quit out, otherwise they put their id in the array.

The cashier takes the left most id from the queue whenever possible, erases it from the queue and shifts the rest of the values to the left, waits 5 sec, and repeats.

When the cashier finishes with a customer, the customer thread quits.

NOTE: You should have it print out info for each of these steps from all of the threads whenever they happen, plus the state of the queue whenever it changes.

Taidot: C-ohjelmointi

Näytä lisää: i m a designer and i need a programmer for my portfolio website, i need a programmer columbus ohio, i need a programmer for linux, i need a programmer for my invention, i need a programmer for video analysis, i need a programmer for xslx, i need a programmer in bhopal, i need a programmer in edinburgh, i need a programmer in hong kong, i need a programmer in ny, i need a programmer that knows c 11, i need a programmer to design a first person maze, i need a programmer to develop a program for me, i need a programmer to develop an app in nz, i need a programmer who can build tv keno games, i need a programmer who can do a sentiment analysis, i need a programmer, i need an expert on whmcs to make a very simple job, i need php programmer, i need python programmer

Tietoa työnantajasta:
( 0 arvostelua ) Stillwater, United States

Projektin tunnus: #22207804

Myönnetty käyttäjälle:

kaloyan13

I have done simulation task, like yours. C and Linux are my top level skills. Threading is my special skill. Can do your task for a few hours.

$70 USD 1 päivässä
(304 Arvostelua)
7.0

16 freelanceria on tarjonnut keskimäärin 176$ tähän työhön

koustav2006

HI..I am proficient in C/C++ programming for multithreaded applications using POSIX threads along with semaphores/mutextes to sync them for access to shared resources and can write the C program as console with given f Lisää

$100 USD 2 päivässä
(111 arvostelua)
5.9
Programmer59

Hello Sir, I am expert in it I can help you with it also I can start form now can we discuss ? I am waiting your response Thank you

$200 USD 7 päivässä
(26 arvostelua)
5.5
usmanshery

hello, i have good background with simulation projects related to OS. have done quite a few in this regards. i can do this for you. Regards

$50 USD 3 päivässä
(64 arvostelua)
5.2
sodiqa32

Hello, I am pleasure with your job as detailed. Thank you for the job posting. It’s a pleasure to meet you. I’d really like to work with you on this one if possible! I do have a couple of questions, but first I’d like Lisää

$30 USD 1 päivässä
(12 arvostelua)
4.6
Softeria

Hello friend, I did MS Software Engineering. I have 7 years of experience in software development. I can do any simple task (e.g. data structures or OOP) to complex problems (e.g. ML and AI). I work on JAVA, C, C++, Py Lisää

$140 USD 7 päivässä
(6 arvostelua)
3.9
george19921014

Hi, I am George. I have read your project and really made me motivated to place a bid on your project. The main purpose of your project is how to use the thread in c programming. I have developed so many projects by us Lisää

$200 USD 1 päivässä
(6 arvostelua)
3.7
wwwTom

Greetings. Thanks for this opportunity. I am a preferred C program developer with over 6 years experience and a strong workforce of many Professionals. -My Service Guarantee-- *24*7 hours live support. *Free of cost t Lisää

$180 USD 1 päivässä
(2 arvostelua)
2.8
kalyanprakash123

keen to do it, please discuss. Negotiable price............................................................

$93 USD 3 päivässä
(2 arvostelua)
2.2
Bobga

Greetings! I have gone through project and I know what you are looking for. I have done similar work in the past, so it won't take much of your time. Do not pay me until you get full satisfaction. I am looking forward Lisää

$250 USD 7 päivässä
(1 arvostelu)
0.7
Aliajam0220

I have read your project description completely. I am ready for all the required skills and I can jump into this project just from now. As a Software Engineering guru, I am always focusing on quality and feel confident Lisää

$150 USD 1 päivässä
(0 arvostelua)
0.0
mtroz310

Hello, I've read your post carefully. Your project is suitable for me and I can do it perfectly. I am a senior C, C++ developer with rich experiences. Once you choose me, I can complete it in short time with high quali Lisää

$200 USD 2 päivässä
(0 arvostelua)
0.0
Olhakostova

Dear Sir! I have 4+ years expert experiences with low level c programming and Linux programming. As you know, this project needs deep concepts of POSIX threads and mutex of them. And also many experiences. So, if you Lisää

$700 USD 7 päivässä
(0 arvostelua)
0.0
alexanderanisimo

Hello. I saw your description in carefully. I have an experience in C/ C++ . I can complete for several hours. please give me a chance to work with you. Thank for reading my cover letter.

$100 USD 1 päivässä
(0 arvostelua)
0.0
evgeny1002

Hi Your job is some interesting. With deep knowledge of C including thread, garbage collection in C, assemblies, kernel architecture on windows I will do it easily and clearly. You will check this with simple test. I Lisää

$200 USD 7 päivässä
(0 arvostelua)
0.0
umairkaramat24

Hello There. How are you doing?. I have read the description, I have great experience doing similar jobs related to these skills C Programming. Please start the chat so we can have detailed discussion. Thanks. Hi freel Lisää

$155 USD 9 päivässä
(0 arvostelua)
0.0