tags:

views:

31

answers:

1

Hello,

I have a buffer in class 'bufferClass' that will generate a signal to tell 'fileClass' that buffer is full and now write data to file? And when 'fileClass' is done writing to file, it will generate a signal to tell 'guiClass' that data can be read from file.

Is this possible? I have been reading http://www.gnu.org/s/libc/manual/html_node/Signal-Handling.html but not too sure how to generate such a signal? I don't need the exact code, just an idea.

Much appreciated.

i am using mac os X, x-code.

A: 

I would use threading.

By having your main class 'fileClass' spin off a thread called 'bufferclass'. When buffer class exits succesfully you will know that your buffer is full.

Intermediate thread url below http://www.cs.cf.ac.uk/Dave/C/node29.html

george9170
can i use a thread to fire a signal and handle it by another thread?
rashid
Yes, it is a little complicated for just starting. what i would do is use a thread to fire off you signal then have something listening to your thread and once the signal is fired off, start a new thread.
george9170