C (Thread,Semaphore) Bilgisayar-Yazılım Mühendisleri Arkadaşlar
-
Evet arkadaşlar c ile ilgili bir problem var hakim olanlar yardımcı olabilir mi?
Problem: Implementation of producer-consumer concept, using multiple threads.
A. You are asked to implement a banking application, details of which are as follows:
1) Customer threads produce deposit or credit transactions “customer id, deposit/debit, amount”, using a buffer.
2) Bank threads process the customer credit/debit transactions, if exist ın the buffer.
3) For each new customer transaction, a new bank thread is created to process the transaction.
4) Customer transactions happen randomly in interval of 1-10 seconds.
5) Allow application to run for 100 seconds.
6) Assume shared buffer maximum capacity is 1000 entries.
7) Establish atomicity for buffer updates and related shared variables.
İmplementation notes: You may represent buffer in any way you like, dynamically or statically.
Hint:
(1) Use proper variables to act as pointers to control the buffer update by the producer and consumer.
(2) Use semaphores to allow correct updates
B. Use pipe instead of the shared buffer to do the same. This time the customer transactions are created by one process, the processing of the customer transactions is done by another. Each transaction is created and processed by a different thread.
-
En azindan bir seyler yapsaydin, nerede takildin? Eger hepsinde takildiysen tek tek calisman gereken konular yaziyor orada hocam.
-
Bu chapteri anladıktan sonra çözebiliyor olman lazım problemi.
http://pages.cs.wisc.edu/~remzi/OSTEP/threads-sema.pdf
-
edit.
whopper tarafından 09/Nis/19 09:01 tarihinde düzenlenmiştir -
neresine yardımcı olunacak
-
TheM4D bunu yazdı
neresinde yardımcı olunacak
Problemin çözüm ve teslimi kısmında
c semaphore bilgisayar mühendisliği yazılım mühendisliği thread yazılım mühendisliği