interrupts and mutual exclusion
I need help in design for the following situation:
There is a background handler running and catching socket messages which generates a SIGIO interrupts. This interrupt invokes a handler which looks at the data on the socket and in return calls the appropriate function for it. Now the problem is some of the datastructures used are linked lists, queues, ect.. What is best way I can prevent the interrupt from messing up the list, such as when I am deleting an item and an interrupt comes in. I think a signprocmask would work with BLOCK and UNBLOCK before and after the datastructure code. I just want to verify that sigpending would work properly espeically if more signals than just SIGIO are used.
Thanks
|