![EBK MATERIALS SCIENCE AND ENGINEERING:](https://www.bartleby.com/isbn_cover_images/9781118357033/9781118357033_largeCoverImage.gif)
EBK MATERIALS SCIENCE AND ENGINEERING:
9th Edition
ISBN: 9781118357033
Author: Callister
Publisher: VST
expand_more
expand_more
format_list_bulleted
Question
Chapter 2.10, Problem 10QP
To determine
The two inert gases that are identical electron structures of
Expert Solution & Answer
![Check Mark](/static/check-mark.png)
Want to see the full answer?
Check out a sample textbook solution![Blurred answer](/static/blurred-answer.jpg)
Students have asked these similar questions
The following problem concerns the way virtual addresses are translated into physical addresses.
Thememory is byte addressable.
• Memory accesses are to 1-byte words (not 4-byte words).
• Virtual addresses are 16 bits wide.
• Physical addresses are 13 bits wide.
•The page size is 512 bytes.
• The TLB is 8-way set associative with 16 total entries.
• The cache is 2-way set associative, with a 4 byte line size and 16 total lines.
In the following tables, all numbers are given in hexadecimal. The contents of the TLB, the page table for the first 32 pages, and the cache
are as follows:
TLB
Page Table
2-way Set Associative Cache
Index
Tag
PPN Valid
VPN PPN Valid VPN PPN Valid
Index Tag Valid Byte 0 Byte 1 Byte 2 Byte 3 Tag Valid Byte 0 Byte 1 Byte 2 Byte 3
0
09
4
1
00
6
1
10 0
1
0
19
1
99
11
23
11
00 0 99
11 23 11
12
2
1
01
5
0
11
5
0
1
15
0
4F
22
EC
11
2F 1
55
59
OB
41
10
0
1
02
3
1
12
2
1
2
1B
1
00
02
04
08
OB
1
01
03
05
07
08
5
03
4
1
13
4
0
3
06
0
84
06
B2
9C
12
0
84
06 B2 9C
05
7
1
04…
Part II (8 points)
int counter = 0;
void handler(int sig)
{
counter++;
}
int main()
{
int i;
signal(SIGCHLD, handler);
for (i = 0; i < 5; i ++){
if (fork() == 0){
}
}
exit(0);
/* wait for all children to die */
while (wait(NULL) != -1);
printf("counter = %d\n", counter);
return 0;
}
A. Does the program output the same value of counter every time we run it?
Yes
No
B. If the answer to A is Yes, indicate the value of the counter variable. Otherwise, list all possible values
of the counter variable.
Answer: counter =
A useful helper function for opening a socket connection to a server was introduced in the course:
int open_clientfd(char *hostname, int port)
{
int clientfd;
struct hostent *hp;
struct sockaddr_in serveraddr;
if ((clientfd = socket(AF_INET, SOCK_STREAM, 0)) h_addr_list[0],
(char *)&serveraddr.sin_addr.s_addr, hp->h_length);
serveraddr.sin_port = htons(port);
/* Establish a connection with the server */
if (connect(clientfd, (SA *) &serveraddr, sizeof(serveraddr)) < 0)
return -1;
return clientfd;
}
The problem with this function is that it is not thread safe: it uses function gethostbyname, which
returns a pointer to a static variable. On the following page, reimplement open_clientfd in a thread
safe way using the lock-and-copy technique. (Note 1: that the new function will take an additional
input: a semaphore that will control access to the critical section so only one thread at a time can call
gethostbyname and read the result stored in a static variable. Note 2: a call to malloc is…
Chapter 2 Solutions
EBK MATERIALS SCIENCE AND ENGINEERING:
Ch. 2.10 - Prob. 1QPCh. 2.10 - Prob. 2QPCh. 2.10 - Prob. 3QPCh. 2.10 - Prob. 4QPCh. 2.10 - Prob. 5QPCh. 2.10 - Prob. 6QPCh. 2.10 - Prob. 7QPCh. 2.10 - Prob. 8QPCh. 2.10 - Prob. 9QPCh. 2.10 - Prob. 10QP
Ch. 2.10 - Prob. 11QPCh. 2.10 - Prob. 12QPCh. 2.10 - Prob. 13QPCh. 2.10 - Prob. 14QPCh. 2.10 - Prob. 15QPCh. 2.10 - Prob. 16QPCh. 2.10 - Prob. 17QPCh. 2.10 - Prob. 18QPCh. 2.10 - Prob. 19QPCh. 2.10 - Prob. 20QPCh. 2.10 - Prob. 21QPCh. 2.10 - Prob. 22QPCh. 2.10 - Prob. 23QPCh. 2.10 - Prob. 24QPCh. 2.10 - Prob. 25QPCh. 2.10 - Prob. 26QPCh. 2.10 - Prob. 27QPCh. 2.10 - Prob. 1SSPCh. 2.10 - Prob. 2SSPCh. 2.10 - Prob. 1FEQPCh. 2.10 - Prob. 2FEQPCh. 2.10 - Prob. 3FEQPCh. 2.10 - Prob. 4FEQP
Knowledge Booster
Similar questions
- A. The box below shows the format of a virtual address. Indicate (by labeling the diagram) the fields (if they exist) that would be used to determine the following: (If a field doesn't exist, don't draw it on the diagram.) VPO The virtual page offset VPN The virtual page number TLBI The TLB index TLBT The TLB tag 15 14 13 12 11 10 98 76543210 B. The box below shows the format of a physical address. Indicate (by labeling the diagram) the fields that would be used to determine the following: PPO The physical page offset PPN The physical page number CO The block offset within the cache line The cache index Cl ст The cache tag 12 11109876543210arrow_forwardSuppose we have a program as follows: #include #include int i = 0; void *do_stuff(void *arg) { } i++; return NULL; int main() { } pthread_t tid1, tid2; pthread_create(&tid1, NULL, do_stuff, NULL); pthread_create(&tid2, NULL, do_stuff, NULL); pthread_join(tid1, NULL); pthread_join(tid2, NULL); printf("%d\n", i); return 0; Recall that because i is a global variable, i++; will compile to something like this: 400728: 8b 04 25 40 10 60 00 mov 0x601040,%eax 40072f: 83 c0 01 add $0x1,%eax 400732: 89 04 25 40 10 60 00 mov %eax,0x601040 A. (8 points) What are all possible outputs of this program? For each output, explain how the kernel could interleave execution of the two child threads to produce it.arrow_forwardFor the given virtual address, indicate the TLB entry accessed, the physical address, and the cache byte value returned in hex. Indicate whether the TLB misses, whether a page fault occurs, and whether a cache miss occurs. If there is a cache miss, enter "-" for "Cache Byte returned". If there is a page fault, enter "-" for "PPN" and leave parts C and D blank. Virtual address: 1DDE A. Virtual address format (one bit per box). 15 14 13 12 11 10 9 8 7 6 4 3 2 1 0 B. Address translation Parameter Value VPN Ox TLB Index Ox TLB Tag Ox TLB Hit? (Y/N) Page Fault? (Y/N) PPN Ox C. Physical address format (one bit per box) 12 11 10 9 8 765 D. Physical memory reference Parameter Value Byte offset Ox Cache Index Ox Cache Tag Ox Cache Hit? (Y/N) Cache Byte returned Ox 4 3 2 1 0arrow_forward
- Consider the C program below. (For space reasons, we are not checking error return codes, so assume that all functions return normally.) int main() { if (fork() == 0) { if (fork() == 0) { printf("3"); } pid_t pid; int status; wait(&status)) > 0) { printf("4"); } else { if ((pid } } } else { } printf("2"); exit(0); printf("0"); return 0; For each of the following strings, circle whether (Y) or not (N) this string is a possible output of the program. A. 32040 Y N B. 34002 Y N C. 30402 Y D. 23040 E. 40302 Y > > Y N Z Z Z N Narrow_forward(read image)arrow_forward(read image)arrow_forward
- (read image)arrow_forward(read me)arrow_forwardA four-lane undivided multilane highway (two lanes in each direction) has 11-ft lanes, 4-ft shoulders, and 10 access points per mile. It is determined that the roadway currently operates at capacity with PHF = 0.80 and a driver population adjustment of 0.9. If the highway is on level terrain with 8% large trucks and buses (no recreational vehicles) and the speed limit is 55 mi/h, what is the directional hourly volume?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- MATLAB: An Introduction with ApplicationsEngineeringISBN:9781119256830Author:Amos GilatPublisher:John Wiley & Sons IncEssentials Of Materials Science And EngineeringEngineeringISBN:9781337385497Author:WRIGHT, Wendelin J.Publisher:Cengage,Industrial Motor ControlEngineeringISBN:9781133691808Author:Stephen HermanPublisher:Cengage Learning
- Basics Of Engineering EconomyEngineeringISBN:9780073376356Author:Leland Blank, Anthony TarquinPublisher:MCGRAW-HILL HIGHER EDUCATIONStructural Steel Design (6th Edition)EngineeringISBN:9780134589657Author:Jack C. McCormac, Stephen F. CsernakPublisher:PEARSONFundamentals of Materials Science and Engineering...EngineeringISBN:9781119175483Author:William D. Callister Jr., David G. RethwischPublisher:WILEY
![Text book image](https://www.bartleby.com/isbn_cover_images/9781119256830/9781119256830_smallCoverImage.gif)
MATLAB: An Introduction with Applications
Engineering
ISBN:9781119256830
Author:Amos Gilat
Publisher:John Wiley & Sons Inc
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337385497/9781337385497_smallCoverImage.gif)
Essentials Of Materials Science And Engineering
Engineering
ISBN:9781337385497
Author:WRIGHT, Wendelin J.
Publisher:Cengage,
![Text book image](https://www.bartleby.com/isbn_cover_images/9781133691808/9781133691808_smallCoverImage.gif)
Industrial Motor Control
Engineering
ISBN:9781133691808
Author:Stephen Herman
Publisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9780073376356/9780073376356_smallCoverImage.gif)
Basics Of Engineering Economy
Engineering
ISBN:9780073376356
Author:Leland Blank, Anthony Tarquin
Publisher:MCGRAW-HILL HIGHER EDUCATION
![Text book image](https://www.bartleby.com/isbn_cover_images/9780134589657/9780134589657_smallCoverImage.gif)
Structural Steel Design (6th Edition)
Engineering
ISBN:9780134589657
Author:Jack C. McCormac, Stephen F. Csernak
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9781119175483/9781119175483_smallCoverImage.gif)
Fundamentals of Materials Science and Engineering...
Engineering
ISBN:9781119175483
Author:William D. Callister Jr., David G. Rethwisch
Publisher:WILEY