Find Jobs
Hire Freelancers

project

$30-40 USD

Selesai
Disiarkan lebih dari 22 tahun yang lalu

$30-40 USD

Dibayar semasa penghantaran
You may choose to implement your programs eighter in UNIX or Windows (NT/2000) environment. (30 points) Implement a C or C++ program that takes two command line arguments, double values A and B, computes and outputs How many iterations of A = sin(A + sin(B)) are required before the value of A converges to within 10-15. How many iterations of A = cos(A + cos(B)) are required before the value of A converges to within 10-15. a line stating which of the two equations took fewer iterations to converge. you are required to invoke two child processes to solve this problem: one child to calculate (but not print) the number of iterations that the sin formula takes. And then sends that result to the other child process, the other child to calculate and print the number of iterations that the cos formula takes, and receive the result from the first child process, print it, and compare the two values. (So the parent process ends up doing very little, other than settings things up, spawning the child processes, and waiting for them to die.) Use fork to spawn the child processes. You are free to choose the means of communication to pass that value from the first child to the second child. (30 points) Write a program than does the same as part 1, except that you are required use threads rather than fork'ed processes. In addition to the main thread, create two additional threads: one to calculate (but not print) the number of iterations that the sin formula takes. And then make that result available to the other thread, the other to calculate and print the number of iterations that the cos formula takes, and receive the result from the first thread, print it, and compare the two values. (So the main thread ends up doing very little, other than settings things up, spawning the two threads, and waiting for them to die.) Use shared variables as the means of communication between the threads. (Hint: You don't need pipe.) Also, since the two threads are started at the same time, and the second needs to know when the data from the first is available, some form of synchronization is required. You may do this using semaphores. (For example: have the main thread lock the semaphore before it calls the two threads, have the first thread unlock it when the data is ready, and have the second thread lock it as it starts.) (30 points) Implement a solutions for the bounded-buffer producer/consumer problem. Your implementation sh ## Deliverables Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased. ## Deadline information 12-9-01
ID Projek: 2833735

Tentang projek

6 cadangan
Projek jarak jauh
Aktif 22 tahun yang lalu

Ingin menjana wang?

Faedah membida di Freelancer

Tetapkan bajet dan garis masa anda
Dapatkan bayaran untuk kerja anda
Tuliskan cadangan anda
Ianya percuma untuk mendaftar dan membida pekerjaan
Dianugerahkan kepada:
Avatar Pengguna
See private message.
$29.75 USD dalam 14 hari
4.6 (66 ulasan)
5.1
5.1
6 pekerja bebas membida secara purata $28 USD untuk pekerjaan ini
Avatar Pengguna
See private message.
$34 USD dalam 14 hari
5.0 (18 ulasan)
6.3
6.3
Avatar Pengguna
See private message.
$34 USD dalam 14 hari
4.8 (43 ulasan)
5.4
5.4
Avatar Pengguna
See private message.
$25.50 USD dalam 14 hari
4.8 (16 ulasan)
3.1
3.1
Avatar Pengguna
See private message.
$29.75 USD dalam 14 hari
0.0 (0 ulasan)
0.0
0.0
Avatar Pengguna
See private message.
$12.75 USD dalam 14 hari
0.0 (0 ulasan)
0.0
0.0

Tentang klien

Bendera UNITED STATES
United States
5.0
2
Ahli sejak Okt 30, 2002

Pengesahan Klien

Pekerjaan lain daripada klien ini

project 3
$30-5000 USD
Terima kasih! Kami telah menghantar pautan melalui e-mel kepada anda untuk menuntut kredit percuma anda.
Sesuatu telah berlaku semasa menghantar e-mel anda. Sila cuba lagi.
Pengguna Berdaftar Jumlah Pekerjaan Disiarkan
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuatkan pratonton
Kebenaran diberikan untuk Geolocation.
Sesi log masuk anda telah luput dan telah dilog keluar. Sila log masuk sekali lagi.