Find Jobs
Hire Freelancers


£250-750 GBP

Publié il y a environ 3 ans

£250-750 GBP

Payé lors de la livraison
you will write a program that will package books published by different publishers. You will have publisher and packager threads. After publishers publish books, packagers package the books published.  The number of publisher types, publisher and packager threads will be given as command line argument. (i.e. You will have n number of publisher types. Each publisher type will have m publisher threads (at total, there will be m*n publisher threads). There will be k number of packager threads. All these numbers (n, m, and k) will be given as command line arguments.)  Each publisher type threads will publish one type of book. The number of books that will be published by each publisher type will be given as command line argument.  The books will be named according to its publisher type, i.e., the lth book published by the ith type of publisher will be named Booki_l.  After publishing a new book, each publisher thread will put it in a buffer that is shared among the same type of publisher. (Each publisher type will have its own buffer.) The buffers’ initial size will be given as command line argument.  When its buffer is full, the publisher thread that wants to put a book will double the size of the buffer.  When each publisher thread publishes required number of books, they will exit the system.  Packagers package the books published. They will take books from the buffers (each packager thread can take books from all buffers).  Each packager thread will put some number of books in a package. This number will be given as command line argument.  After one package is prepared, packager thread will prepare another package.  Packagers will select the book type to put into package randomly. Then, it will take the book from the related buffer and put it into its own package.  If a buffer of the publisher type randomly chosen by the packager thread is empty, the packager thread will check whether there are threads left in the system that belongs to chosen type. If so, it will wait for the publisher thread to publish a book and put it into the buffer. Otherwise, it will select another buffer. 1  If a packager thread finds all buffers empty after all publisher threads exit the system, it will print the message: “Only i of j number of books could be packaged.” and leave the system. So, you need to keep track of how many publisher threads are left for each type. Program Details  The user will execute the program specifying the number of threads to be created of each kind. You will then create the specified number of threads of each type.  The same type of publisher threads will share the same buffer. Make sure that no multiple publisher thread will attempt to put their books on the same place of the buffer.  Note that packager threads can access to all buffers. Make sure that no multiple package thread will attempt to get the same book from the buffer.  Make sure that publisher and packager threads work concurrently. This means that when a publisher thread puts and item to the buffer, no packager can take an item from the buffer.  The main thread is responsible for creating all of the threads and waiting for them. Note that, all of the threads has to exist in the system at the same time, and you have to work on synchronizing them.  All the threads have to print information about their job on the screen (see the example execution below).  Note that there are global buffers requested and the buffers can be accessed by many threads of different types so a synchronization and mutual exclusion are necessary for the buffer. This can be achieved by using the semophores and mutexes.  The global buffers have to be created at the very first time a thread needs to use it by that thread.  Preserving consistency and preventing deadlocks are major issues to be considered.  Your program will be executed as follows: o Example: ./[login to view URL] -n 2 3 4 -b 5 -s 6 7 o The -n option represents the type and number of threads. Here
N° de projet : 28993498

Concernant le projet

4 propositions
Projet à distance
Actif à il y a 3 ans

Cherchez-vous à gagner de l'argent ?

Avantages de faire une offre sur Freelancer

Fixez votre budget et vos délais
Soyez payé pour votre travail
Surlignez votre proposition
Il est gratuit de s'inscrire et de faire des offres sur des travaux
4 freelancers are bidding on average £388 GBP for this job
Avatar de l'utilisateur
Hello Sir/ Ma’am We are a group of Software Engineers (Programmers) having 10+ years of experience. Expert in JAVA, C, C++ , C# , Python, MATLAB. Done 700+ projects here on FREELANCER.COM. The bid is negotiable and we can talk about the price. Thank you
£250 GBP en 1 jour
4,8 (283 commentaires)
Avatar de l'utilisateur
Hi there! I have read what you exactly need, however I would like to ask you a few questions. I do work smart and do not rest until I get the job done. Please feel free to ping me anytime so we can have a detailed discussion. If I can deliver I will deliver in best possible way. Thanks My portfolio:
£750 GBP en 27 jours
5,0 (9 commentaires)
Avatar de l'utilisateur
Hi there.I am very familiar with c/c++ language.I have already worked for 6 years dealing with algorithm & data structure.I've checked your attached project and I am very interested in your project. When do you need the project finished by? ----------------------------------------------------------------------------------------------- Hope to meet and have a talk. please contact me and discuss more detail Thank you.
£300 GBP en 7 jours
5,0 (9 commentaires)
Avatar de l'utilisateur
Hello Client, I am Full Stack Freelance Developer and Read your requirements about Full stack developer and interested to work on this project with you. I'm highly skilled in React, Angular JS, Node JS, C, C++, JAVA, Laravel, PHP, HTML 5, CSS 3. I would like you to consider me for your services. I'll be guaranteed you that you will get the best product quality in a very optimal budget and time frame. Looking forward to your requirement to analyze and collaborate with you. Regards.
£250 GBP en 1 jour
4,8 (3 commentaires)

À propos du client

dbrsnu6, United States
Membre depuis janv. 17, 2021

Vérification du client

Merci ! Nous vous avons envoyé un lien par e-mail afin de réclamer votre crédit gratuit.
Une erreur a eu lieu lors de l'envoi de votre e-mail. Veuillez réessayer.
Utilisateurs enregistrés Total des travaux publiés
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Chargement de l'aperçu
Permission donnée pour la géolocalisation.
Votre session de connexion a expiré et vous avez été déconnecté. Veuillez vous connecter à nouveau.