Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fork processing 2

Status
Not open for further replies.

shetlandbob

Programmer
Mar 9, 2004
528
GB
Hello,

If I have an application (i do as it happens!) that I wish to perform "backround tasks" can I do this by "forking" my use of the processor (i believe this is done in UNIX for any one who knows this?).

Scenario:

I have a main application that I want active and running all the time, while every few seconds I want to check another background process. Before you all shout "TIMER FUNCTIONS" I have tried these and they dont work. The reason is that my second application waits for a variable time before returning a result (this can be milliseconds to many minutes), thus when my timer activates this function the whole program will freeze until it receives a return signal from the secondary function. Hence if I had my processing power "forked" then only a percentage of my use would be taken up by this function, thus the main application would work.

Does anyone understand the question? If you do and have any ideas/clues I'd much appreciate them!

Cheers
 
You could use AfxBeginThread and have it post messages back to your app which you could process.

Matt
 
As mentioned, multithreading is the thing youre after.

See faq116-5162

/Per

"It was a work of art, flawless, sublime. A triumph equaled only by its monumental failure."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top