Link to home
Start Free TrialLog in
Avatar of autistic
autistic

asked on

Launch threading in CGI

i have a C++ CGI program. i want the CGI (or any other way) to launch an executable program, a threading program, which calls and checks another module. the threading program would notify the cgi if the another module has input data, and pass the input data to the CGI.

since it is a threading program, i don't want the program to die even if i am navigating to other pages. i just want to receive notifications from the threading program about what is happening on the other module.

thanks very much! i am really desperate............. (it's also my first time about CGI, so please help me) :)
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Are you really talking about CGI used in a web server, where it is called from a browser?
Then I guess it does not make much sense to use a "threading program" (whatever this means) 'cause HTTP is a stateless protocoll. Even if the CGI contacts your threads, it needs to wait 'til it gets the response from the thread to pass it back to the browser.

Probably I misunderstood your requirement, then please explain in more detail what to want to do.
Avatar of autistic
autistic

ASKER

yeah, im talking about "CGI used in a web server, where it is called from a browser". or when a button is pressed..

i need the threading program, so any changes to the module that i was monitoring would be reflected to the HTML UI.

similar result of it would probably be yahoo mail (or the likes) which automatically updates the UI if new mails arrive..something like that...

if you have any other suggestions, please tell me.. its just my first time with CGI :)
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i got your point.. the thing is, before the "browser periodically calls the server", there are still two modules below the server (ex. server is checking moduleA, and moduleA is checking moduleB). if "browser periodically calls the server", does this mean that polling should also be implemented in moduleA and moduleB? how would server trigger moduleA(and moduleA trigger moduleB)?

im such a newbie in web programming, so pls help...thanks!
btw, i just asked the client, and he said that periodic calls to the server is not an option since he wants "immediate" change on the web browser (meaning refreshing even every 5 secs is not accepted), or runtime.. any more ideas? pls....

so it really is more likely that the module is prompting the web server to change the current browser display... help..
> .. and moduleA is checking moduleB
and
> .. should also be implemented in moduleA and moduleB?
I guess you are not used to what moduleA and moduleB is doing.
To what else should moduleB talk if it is called by moduleA?

> .. is not an option since he wants "immediate" change on the web browser
tell him, that he should by a fat client client-server application *not* based on HTTP

Again: it is impossible that your server connects back to the browser (speaking about HTTP).
hey thanks... i implemented the meta refresh(calling the .cgi every refresh). i refresh every 5secs, since this is the "closest" solution available.. :)