Hank Lee
BAN USERAlumni of UPenn
Questions (14)
Comments (1)
Reputation 145
- 1of 1 vote
AnswersImplement atoi(char *p)
- Hank Lee| Report Duplicate | Flag | PURGE
NVIDIA Software Engineer / Developer Coding - 0of 0 votes
AnswersReverse linked-list
- Hank Lee| Report Duplicate | Flag | PURGE
NVIDIA Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersWhat is happened when a user press a key on the keyboard? (Keyboard generates an interrupt and interrupts the CPU, CPU saves the current process state and executes interrupt handler, CPU returns from interrupt, kernel later on executes device driver to fetch register data from I/O port, ...)
- Hank Lee| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer Terminology & Trivia - 0of 0 votes
AnswerWhat is in IP header?
- Hank Lee| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer Coding
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
About 3., one of the question is WHY disabling interrupt only works in single core processor. The reason to disable the interrupt in your case is you want to implement mutual exclusion. Besides memory shared mutex implementation, there is another way to provide mutual exclusion, which is to disable the interrupt. By disabling interrupt, a process will not be context switched out of CPU, if this process doesn't make any system calls which cause process to sleep.
- Hank Lee May 11, 2008Therefore, on uni-processor system if you disable the interrupt, you will be happily executes your critical section because you can't possibly be preempted. However, it doesn't work in multi-core system, because your process will only hold one core, but at the same moment another thread can execute the critical section your process is working. So in this case this implementation of mutual exclusion fails.