| ▲ | kccqzy 2 hours ago | |||||||
Another time when writing a quick and dirty spinlock is reasonable is inside a logging library. A logging library would normally use a full-featured mutex, but what if we want the mutex implementation to be able to log? Say the mutex can log that it is non recursive yet the same thread is acquiring it twice; or that it has detected a deadlock. The solution is to introduce a special subset of the logging library to use a spinlock. | ||||||||
| ▲ | wizzwizz4 an hour ago | parent [-] | |||||||
I'm not sure how a spinlock solves this problem. Wouldn't that just cause the process to hang busy? | ||||||||
| ||||||||