Ace the Programming Interview by Edward Guiness

Ace the Programming Interview by Edward Guiness

Author:Edward Guiness
Language: eng
Format: epub, mobi, pdf
Publisher: John Wiley & Sons
Published: 2013-05-28T16:00:00+00:00


QUESTIONS

This chapter discussed the kinds of situations you might face when fixing a bug. The following questions test your knowledge:

1. Lock ordering Explain the importance of obtaining locks in a fixed order; that is, why is lock ordering important?

2. Locking on “this” Explain why it might be considered bad practice to lock on a reference to the current instance of a class as per the following C# code:

lock (this) { this.Name = “foo”; this.Update(); // etc... }

3. Locking on a string Explain why it might be considered bad practice to lock on a string as per the following C# code:

lock (”my lock”) { this.Name = “foo”; this.Update(); // etc... }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.