?
Solved

Launch threading in CGI

Posted on 2006-10-20
7
Medium Priority
?
273 Views
Last Modified: 2013-12-25
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) :)
0
Comment
Question by:autistic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17772536
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.
0
 

Author Comment

by:autistic
ID: 17772575
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 :)
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 600 total points
ID: 17774821
You server never pushes data to the client, but the client requests them from the server.
Having this in mind you need to build your page in that way the browser periodically calls the server (which breaks the basic rules and design of HTTP, but's usual anyway).

How do you plan to tweak the browser to make the request?
Could by a simple meta refresh tag, or any malicious code (lile JavaScript).
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:autistic
ID: 17785950
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!
0
 

Author Comment

by:autistic
ID: 17787084
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..
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17796485
> .. 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).
0
 

Author Comment

by:autistic
ID: 17872454
hey thanks... i implemented the meta refresh(calling the .cgi every refresh). i refresh every 5secs, since this is the "closest" solution available.. :)
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question