문제

  • What is the inner working of getchar_unlocked()?
  • Why is it thread unsafe?
  • And why it is not employed in windows POSIX?
도움이 되었습니까?

해결책

getchar_unlocked() is not threadsafe, because it might manipulates internal data structures without locking or any other type of synchronisation. For any more detailled answer, you must look at the exact implementation in question.

Omitting thread safety (and being inlined/a preprocessor define) is what makes it fast.

다른 팁

it is used to speed up the program, If speed if not necessary factor in your case try to avoid it because it is not safe.If there is only one thread at a time in your program you can go for it.. :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top