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.
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 functionality.
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 to make you an offer and some background so you can check my work out.
I have been developing kind of project within 4+ years so I’m fluent experience to handle project.
You’ll get all the expected stuff like a great professional service and a fast turnaround, at a bit less, and I get a bit more exposure.
If the above offer sounds like something you would be interested in, I’d love to hear from you.
Best regards,
Adebayo
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++, Python, SQL, MySqL and Oracle. Please see my profile and reviews from my previous client. I guarantee quality work in less time. Contact me. Thanks
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 using c so that thread problem is really basic one.
Please message me and discuss more details.
Regards.
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 hire me, I'll do it very clearly and completely.
Thanks.
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.
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 hope to work with you.
Thanks.
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 freelancin918! Please Send me a message so that we can discuss more about this project