Find Jobs
Hire Freelancers

Threads & Synchronization

$10-30 USD

Fechado
Publicado há quase 4 anos

$10-30 USD

Pago na entrega
Due date: 7 june Objective The objective is to develop a multithreaded application using pthreads for flower delivery. Clients will make requests for flowers, a central thread will collect those requests, and then delegate the work to the closest florist that has the kind of flower requested. How You are provided with a file containing the list of florists and the type of flowers that they sell (they have an infinite amount of each). e.g. Ayse (10,25; 1.5): orchid, rose, violet means the florist Ayse sells the three mentioned types of flowers, and her shop is located at location (10,25) in a cartesian 2D grid and her deliveries are made with an average speed of 1.5 clicks per ms. The file also contains the requests made by clients: e.g. client1 (55,76): orchid means that client1 is located at (55,76) and has made a request for a single romantic orchid. Your central/main thread will have a pool of one thread for every florist. Then it will start processing the clients’ requests one by one. For each request, it will delegate it to the closest florist with respect to the client using the Chebyshev distance. The florist receiving a request (i.e. a flower order) will prepare it and deliver it, by printing on screen how long it took it in total (= time of preparation + time of delivery; use the speed and distance information). The preparation of every order at the florist requires a uniformly random amount of time between 1 to 250 ms (closed interval). You can simulate it by letting the thread sleep for a random duration (equal to the time of preparation + time of delivery). Important: the central thread must process the requests as fast as possible, that means it should delegate the request to the closest florist even if she/he is busy preparing/delivering a request in the meantime (hint: you could use a request queue for each florist). Once all requests have been processed, all florist threads should terminate and return their sale statistics (i.e. how much time each florist spent in total for preparing and delivering the requests) to the central thread which will then print on screen that information in a nicely formatted table along with the number of requests handled by each client. If everything goes well your application should print on screen something similar to the following (the numbers are made up): $floristApp -i [login to view URL] Florist application initializing from file: [login to view URL] 3 florists have been created Processing requests Florist Fatma has delivered a clove to client2 in 56ms Florist Murat has delivered a rose to client0 in 145ms Florist Murat has delivered an orchid to client1 in 77ms … All requests processed. Ayse closing shop. Murat closing shop Fatma closing shop. Sale statistics for today: ------------------------------------------------ Florist # of sales Total time ------------------------------------------------ Ayse 7 1543ms Fatma 3 750ms Murat 6 1343ms ------------------------------------------------ Rules: • Solve any and all synchronization issues using only mutexes and/or condition variables. • If the command line arguments are missing/invalid your program must print usage information and exit. • You can assume the file is not empty and that its contents have the proper expected format. • Each thread should free allocated resources explicitly. • Never allow zombie processes! • In case of CTRL-C make sure your program (and all its threads) shuts down gracefully, by deallocating all resources and printing an informative message. • Don’t use busy waiting of any kind, don’t use timed waiting, or trylock. There should be a makefile & readme for this work. Code will be test in valgrind, so there should be no errors, no warnings, no memory leaks.
ID do Projeto: 25742820

Sobre o projeto

7 propostas
Projeto remoto
Ativo há 4 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
7 freelancers estão ofertando em média $61 USD for esse trabalho
Avatar do Usuário
I can do your task for a few hours time. C and Pthreads are one of my top skills. Thank you..........
$50 USD em 1 dia
4,9 (431 avaliações)
7,3
7,3
Avatar do Usuário
HI..I am proficient in C programming for writing multithreaded programs using POSIX threads and processes with inter thread/process communication and can complete the project in C as per given specs.
$100 USD em 2 dias
4,9 (149 avaliações)
6,2
6,2
Avatar do Usuário
Hi, I have strong background in Programming and experience in Threads in C. Let me help you. I am ready to start.
$100 USD em 4 dias
5,0 (9 avaliações)
4,0
4,0
Avatar do Usuário
Hi, there! Glad to see you. C/C++/C# programming are my major developing skills as you can see in my review. GUI and console platform are both possible to develop and I can show you my previous work result if you want. I can implement your creative idea to reality immediately. I am looking for a long term relationship. waiting for your valuable reply… Thanks. Regards.
$100 USD em 7 dias
5,0 (10 avaliações)
3,6
3,6
Avatar do Usuário
Hello, My name is Aqeel Ahmed, I've complete MS Software Engineering. I've 5-Year experience in software development and algorithm implementation. My Core Expertise in Java - C++ - C - C# - SQL - object-oriented - Data Structure - Swing - OpenGL - JavaFX. Look at my profile and Important Reviews: https://www.freelancer.com/u/ExpertSoul I'm excited with feeling that I would be able to satisfy your requirements Within Deadline. Please leave a message on my chat so we can discuss the project. Thank.
$20 USD em 4 dias
4,7 (6 avaliações)
3,5
3,5
Avatar do Usuário
Hello. I have great experience with thread synchronization using the C pthread library. I have done many such projects when I was in college for me and my colleagues. Message me if you want to discuss more details
$50 USD em 5 dias
5,0 (1 avaliação)
1,0
1,0
Avatar do Usuário
This is my first project in freelancing platform. I want to do it for free but I had to place minimum bid of dollar 5. I am having nearly 3 years of working experience in fortune 500 companies in C/C++ Linux domain. It would be pleasure to work with you. Looking forward go get first project in freelancing platform. Thank you and have a great day. :)
$10 USD em 5 dias
0,0 (0 avaliações)
0,0
0,0

Sobre o cliente

Bandeira do(a) TURKEY
kocaeli, Turkey
4,8
2
Método de pagamento verificado
Membro desde nov. 26, 2018

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.