subject
Engineering, 07.04.2020 02:30 geunagillis1

Write a program that accepts a phrase of unspecified length on the command line. For example: $ ./osproj2b Operating Systems Class at TAMUCC The main() in this program has to create two threads running functions (vow and cons). The threads should take turns printing the respective words of the phrase supplied on the command line. The vow thread should print all the words that start with a vowel and the cons thread should print all words starting with a consonant. Note that the main thread (running main()) should not print anything itself, the output should be supplied by the threads that it creates. The order of words in the phrase should not be changed in the printout. Your program should work for any phrase of any reasonable length, not just the one given in the example. The output of your program should look similar to the following

$ ./osproj2b Operating Systems Class at TAMUCC vow: Operating cons: Systems cons: Class vow: at cons: TAMUCCIn this part you are *not allowed* to use synchronization primitives such as mutexes for thread coordination. You can use sched_yield() to relinquish control of the CPU. You will have to investigate some of the other pthread functions available to you for this project. Look for examples online. The name of this program must be osproj2b. c or osproj2b. cpp.

ansver
Answers: 3

Another question on Engineering

question
Engineering, 03.07.2019 23:20
Two technicians are discussing the intake air temperature (iat) sensor. technician a says that the computer uses the iat sensor as a backup to the engine coolant temperature (ect) sensor. technician b says that the powertrain control module (pcm) will subtract the calculated amount of fuel if the air measures hot. who is correct
Answers: 3
question
Engineering, 04.07.2019 18:10
Burgers vector is generally parallel to the dislocation line. a)-true b)-false
Answers: 2
question
Engineering, 04.07.2019 18:20
Water vapor initially at 10 bar and 400 °c is contained within a piston-cylinder assembly. the water lost heat to the surrounding according to isochoric (iso-volumetric) process until its temperature is 150 °c. the water is then condensed isothermally to saturated liquid. for the water as a system, calculate the work in kj/kg
Answers: 2
question
Engineering, 04.07.2019 19:20
Asimple speed reducer is composed of 2 spur gears. the pinion gear has a pitch diameter of 0.75" and 36 teeth while the driven gear has a pitch diameter of 4.0" and 192 teeth. a)-what is the diametral pitch of each gear? b)-if an electric motor rotating ccw at 3000 rpm is coupled to the pinion, what is the rotational speed of the driven gear? c)-if the torque delivered to the pinion is 1 n-m, what is the torque on the driven gear? d)-what is the power transmitted by the gear train?
Answers: 1
You know the right answer?
Write a program that accepts a phrase of unspecified length on the command line. For example: $ ./os...
Questions
question
Arts, 23.03.2021 06:50
question
Mathematics, 23.03.2021 06:50
question
Geography, 23.03.2021 06:50
question
Mathematics, 23.03.2021 06:50
question
Physics, 23.03.2021 07:00
question
Mathematics, 23.03.2021 07:00
question
Mathematics, 23.03.2021 07:00
question
Mathematics, 23.03.2021 07:00
question
Mathematics, 23.03.2021 07:00
question
Chemistry, 23.03.2021 07:00
Questions on the website: 13722360