View topic - [HELP] Application idea

[HELP] Application idea

General Help about QNX

[HELP] Application idea

Postby alephan » Tue Nov 03, 2009 7:47 pm

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!
alephan
New Member
 
Posts: 7
Joined: Tue Nov 03, 2009 7:43 pm

RE: [HELP] Application idea

Postby maschoen » Wed Nov 04, 2009 11:09 am

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
maschoen
QNX Master
 
Posts: 2724
Joined: Wed Jun 25, 2003 5:18 pm

Postby alephan » Wed Nov 04, 2009 2:22 pm

In what should i program GUIs in QNX?
alephan
New Member
 
Posts: 7
Joined: Tue Nov 03, 2009 7:43 pm

Postby mario » Wed Nov 04, 2009 3:15 pm

Photon is the main GUI, check out the Photon application builder.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby alephan » Tue Nov 10, 2009 12:34 pm

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?
alephan
New Member
 
Posts: 7
Joined: Tue Nov 03, 2009 7:43 pm

Postby mario » Tue Nov 10, 2009 1:10 pm

Read up on shared memory, or read on QNX message passing.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby alephan » Wed Nov 11, 2009 11:26 am

Would you please provide me some links? :)
alephan
New Member
 
Posts: 7
Joined: Tue Nov 03, 2009 7:43 pm

Postby mario » Wed Nov 11, 2009 12:16 pm

It`s all in the documentation provided with Momentics, do a search on shared memory and read on the QNX architecture section.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby alephan » Wed Nov 11, 2009 1:22 pm

I found it. You're such a help! Thanks!
alephan
New Member
 
Posts: 7
Joined: Tue Nov 03, 2009 7:43 pm

Postby alephan » Thu Nov 26, 2009 11:41 am

Well now i have to develop a new application. Again i'm out of ideas. Good ideas. :) 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!
alephan
New Member
 
Posts: 7
Joined: Tue Nov 03, 2009 7:43 pm

Postby alephan » Tue Dec 01, 2009 8:00 pm

Common mates!
alephan
New Member
 
Posts: 7
Joined: Tue Nov 03, 2009 7:43 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron