Curious. Well if you want to show the use of signals, you might just as well write the program for Linux. They work pretty much the same on both systems. In most cases, while available, they are not the preferred method of inter-process communication under QNX.
What signals do provide is the ability to stop a process in the middle of doing something. So here is an imagined idea.
Let’s say your cpu periodically receives some data which needs to be processed in a relatively long cpu bound calculation. Let’s also assume that once new data is received, if the previous calculation is not complete, it should be immediately stopped and the new calculation should be started.
You could simulate the receipt of data with keystrokes into a GUI program, and do some artificial calculation that takes a long time, say 5 seconds. You could even setup a progress bar on the GUI to see this happening. Here’s what I’m thinking the two programs would look like:
Wait for key and/or Calculation result
If Calculation process is busy, signal it to stop
Send Calculation process key to process it
Calculation process (low priority, unless you have more than 1 cpu)
Wait for message to process key
Hard-loop for 5 seconds
Report calculation complete to GUI