Magnus Hagander wrote: > The other way to go is to try to make the signal handlers thread safe. > Do you know offhand how much code they touch? Since they're not called > often, one could perhaps start with just wrapping all the code they > touch (and that touches the same data they do) in critical sections. > They're very lightweight and shouldn't have a noticeable performance > impact, if it's possible to identify a limited number of locations to > put it in there (as we certainly wouldn't want to bloat the code all > over the place) Don't forget that you have to add the volatile modifier to keep the compiler from optimizing flags outside of loops, etc. for variables that could change inside a critical section. Merlin
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера