Write a program in which a group c 7 threads works. Thread code shou be placed as a class method. Meth parameter iş the thread number (in

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Needed c++ coding please do it in 10 minutes and get thumb up
Write a program in which a group of
7 threads works. Thread code should
be placed as a class method. Method
parameter is the thread number (integer
number). Thread displays in the loop
10 times the message "i = number from
0 to 9, number = thread number". After
displaying each message thread sleeps
for 100 to 500 ms (random value).
Synchronize operations on the console
(use mutex and lock).
To synchronize operations on the console,
use a semaphore instead of a mutex.
Limit (also using semaphore) a maximum
of 3 threads to execute their loop at a
%3D
time.
Except source code include command line
used to compile your program.
2:56 pm
Transcribed Image Text:Write a program in which a group of 7 threads works. Thread code should be placed as a class method. Method parameter is the thread number (integer number). Thread displays in the loop 10 times the message "i = number from 0 to 9, number = thread number". After displaying each message thread sleeps for 100 to 500 ms (random value). Synchronize operations on the console (use mutex and lock). To synchronize operations on the console, use a semaphore instead of a mutex. Limit (also using semaphore) a maximum of 3 threads to execute their loop at a %3D time. Except source code include command line used to compile your program. 2:56 pm
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY