Setup. A user-space library runs three threads inside one pr…
Setup. A user-space library runs three threads inside one process and switches between them itself, so the kernel knows nothing about them and sees one task. The library does not wrap system calls, so each call goes straight to the kernel. Thread T1 calls read(), the data is not ready, and the call waits. Question. What can T2 and T3 do while T1 waits?
Read DetailsSetup. Four threads each add 1 to one shared global variable…
Setup. Four threads each add 1 to one shared global variable, one million times each, so the expected total is 4,000,000. The figure shows one interleaving of two of those threads. Both read the counter while it holds 5, both compute 6 in their own registers, and both write 6 back. Measured. One run printed 1,311,526. Question. What was the effect on the counter?
Read DetailsSetup. A producer flow passes 100,000 records of 1 kB to a c…
Setup. A producer flow passes 100,000 records of 1 kB to a consumer flow, and the same job is built twice on one machine. Build 1 runs the two flows as separate processes, and the records travel through a pipe. Build 2 runs the two flows as two threads of one process, and the records sit in one shared array. Measured. Build 1 made 200,000 system calls to move the records, and it took 0.107 seconds. Build 2 made no system calls to move them, and it took 0.040 seconds. Question. In build 1, what do the two calls per record do?
Read DetailsHannah sues ABC Co., claiming that the company has failed to…
Hannah sues ABC Co., claiming that the company has failed to comply with the terms of a federal law. The lawsuit is filed in a state trial court that has the authority to resolve the dispute. The trial judge rules in favor of Hannah. If the judge’s decision is based on an incorrect interpretation of the law and ABC Co. wants the decision reviewed, ABC Co. should seek to have the case removed to federal court.
Read DetailsSawyer sued Colin for allegedly violating the provisions of…
Sawyer sued Colin for allegedly violating the provisions of a federal statute. The lawsuit was filed in a Texas district court, which has subject matter jurisdiction. The trial judge rules in favor of Colin, concluding that the statute is unconstitutional and unenforceable. The court of appeals agrees, affirming the trial judge’s decision. Sawyer has filed a petition for writ of certiorari. If the constitutionality of the statute raises an issue of nationwide importance, Sawyer’s petition probably will be granted.
Read DetailsA house in an Austin neighborhood has been vacant and neglec…
A house in an Austin neighborhood has been vacant and neglected for years. It is in a state of disrepair and no longer habitable in its current condition. The City of Austin has filed a foreclosure proceeding in a court in Travis County, seeking to acquire ownership of the house. Notice of the legal proceeding is placed in newspapers across the country. Bryce, a resident of Connecticut, reads the notice. He knows that the house belongs to him, having inherited it from his wealthy aunt. Bryce has never been to Texas, however, and has insufficient contacts with the state to satisfy its long-arm statute. Assume that the court has subject matter jurisdiction. If Bryce files a motion to dismiss the foreclosure proceeding for lack of personal jurisdiction, his motion should be denied.
Read DetailsThe lawmakers in State Y have enacted a Food Act that prohib…
The lawmakers in State Y have enacted a Food Act that prohibits the distribution and sale of contaminated food. The statute was passed to protect consumers from the unwitting consumption of food that is not fit to eat. Durham Produce Company (D) imports bananas from Honduras and distributes them to markets in State Y. In the most recent shipment of fruit, the peels of several bananas were split open, and spiders got into the bananas. Several of these spiders bit an employee of D while he was unloading a truck. After receiving medical treatment for the bites, the employee (P) filed a negligence lawsuit against D. P claims that D has violated the Food Act by distributing contaminated food. Under the doctrine of negligence per se:
Read Details