[HELP] Application idea

Hello to all.

I need an idea for a homework that i have at my QNX Subject at University. I need to write an application in c that will use signals. All kind of them (ex. Alarm, SIGIO, SIGHLD etc etc). Not all of them but some.

Gimme an interesting idea. My mind is just out of ideas!

Thanks in advance!

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:

GUI
Loop
Wait for key and/or Calculation result
If Calculation process is busy, signal it to stop
Send Calculation process key to process it
End-Loop

Calculation process (low priority, unless you have more than 1 cpu)
On-Signal
Stop Calculation
End-Signal

Loop
    Wait for message to process key
    Hard-loop for 5 seconds
    Report calculation complete to GUI
End-Loop

In what should i program GUIs in QNX?

Photon is the main GUI, check out the Photon application builder.

Ok i have a problem now. I tried to develop an application that would be a lil text processor. It’s in command prompter. And i have a problem. I have a variable called text - char text[1000]. Here i store the temporary text that it used. This is a process. I have another process that i use to save (backup) to a file from time to time : 20 sec using an alarm. The problem is that i cannot access the text variable from the parent process in this “save” process. How can i solve this?

Read up on shared memory, or read on QNX message passing.

Would you please provide me some links? :slight_smile:

It`s all in the documentation provided with Momentics, do a search on shared memory and read on the QNX architecture section.

I found it. You’re such a help! Thanks!

Well now i have to develop a new application. Again i’m out of ideas. Good ideas. :slight_smile: Right now i want to create a nice application (maybe one that would be applied in real life - or seen in real life) that uses: semaphores and shared memory.

After my last idea request i managed to develop a parking place simulation. It’s a very nice command-based app. If you want the code just let me know.

Thanks a lot for those that would give the help needed. Cheers mates!

Common mates!