EBK COMPUTER SYSTEMS
EBK COMPUTER SYSTEMS
3rd Edition
ISBN: 8220101459107
Author: O'HALLARON
Publisher: YUZU
Expert Solution & Answer
Book Icon
Chapter 12.4, Problem 12.6PP

A.

Explanation of Solution

Analysis from given section:

For variable instance “ptr”:

  • For main thread:
    • From the given code, the variable “ptr” is a global variable.
    • It is written by the main thread.
  • For peer thread 0 and thread 1:
    • The variable “ptr” is read by the peer threads.

For variable instance “cnt”:

  • For main thread:
    • From the given code, the variable “cnt” is a static variable and it is contains with only one instance in memory. Hence, it is not exist in the main thread.
  • For peer thread 0 and thread 1:
    • The variable “cnt” is read and written by the peer threads.

For variable instance “i.m”:

  • For main thread:
    • From the given code, the variable “i.m” is a local automatic variable.
    • It is stored on the stack of the main thread. Hence, this variable is exist in the main thread.
  • For peer thread 0 and thread 1:
    • The given variable is stored on the main thread, while its corresponding value is passed to the peer threads, the peer threads never place it on the stack. So, it is not shared.

For variable instance “msgs.m”:

  • For main thread:
    • From the given code, the variable “msgs.m” is a local automatic variable.
    • It is stored on the stack of the main thread. Hence, it is exist in the main thread.
  • For peer thread 0 and thread 1:
    • The given variable is stored on the main thread...

B.

Explanation of Solution

Analysis of shared variable from part A:

From the part A, the variables “ptr”,...

Blurred answer
Students have asked these similar questions
Which tool takes the 2 provided input datasets and produces the following output dataset? Input 1: Record First Last Output: 1 Enzo Cordova Record 2 Maggie Freelund Input 2: Record Frist Last MI ? First 1 Enzo Last MI Cordova [Null] 2 Maggie Freelund [Null] 3 Jason Wayans T. 4 Ruby Landry [Null] 1 Jason Wayans T. 5 Devonn Unger [Null] 2 Ruby Landry [Null] 6 Bradley Freelund [Null] 3 Devonn Unger [Null] 4 Bradley Freelund [Null] OA. Append Fields O B. Union OC. Join OD. Find Replace Clear selection
What are the similarities and differences between massively parallel processing systems and grid computing. with references
Modular Program Structure. Analysis of Structured Programming Examples. Ways to Reduce Coupling. Based on the given problem, create an algorithm and a block diagram, and write the program code: Function: y=xsin⁡x Interval: [0,π] Requirements: Create a graph of the function. Show the coordinates (x and y). Choose your own scale and show it in the block diagram. Create a block diagram based on the algorithm. Write the program code in Python. Requirements: Each step in the block diagram must be clearly shown. The graph of the function must be drawn and saved (in PNG format). Write the code in a modular way (functions and the main part should be separate). Please explain and describe the results in detail.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage