From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e7151167e0767ecc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews2.google.com!not-for-mail From: wojtek@power.com.pl (Wojtek Narczynski) Newsgroups: comp.lang.ada Subject: Re: State Threads Date: 8 Sep 2004 05:38:06 -0700 Organization: http://groups.google.com Message-ID: <5ad0dd8a.0409080438.40a777c9@posting.google.com> References: <8429999a.0408231027.2850e800@posting.google.com> <4135498c_1@news.tm.net.my> <5ad0dd8a.0409040738.3fff41b8@posting.google.com> <5ad0dd8a.0409060515.4b17e2ed@posting.google.com> <5ad0dd8a.0409070001.7ef611b3@posting.google.com> NNTP-Posting-Host: 62.111.211.178 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1094647088 3681 127.0.0.1 (8 Sep 2004 12:38:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 8 Sep 2004 12:38:08 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:3476 Date: 2004-09-08T05:38:06-07:00 List-Id: Georg, Let me try to answer your questions, even though it regards a higher level of processing. > If a user at a client computer decides to open another view of > some page in a web based application (a tab, a window), would that lead > to the creation of another thread? Calling in st_thread_create(), and only this, leads to the creation of a new thread. Often, you'd call this function after st_accept(), to create a thread to handle new connections. Server doesn't know about browsers and windows, it only deals with sockets and requests/responses. > If not, can thread data safely be used to react to input from > either view? The threads will do what you code them to do. They can access shared, but protected, data. > For example, HTTP is essentially stateless. ST library knows nothing about HTTP, neither do Ada tasks. HTTP/1.1 has the mechanism of cookies, which allow you to maintain a session above http, so can url rewriting be used for that. > Some port receives the input sequence i1, i2, then i1 _again_. > Let ik stand for some Web form. i1 has triggered a state change in the > server's store. This state change might affect the server's reaction to i2 > arriving. ("Go this way if i1 has been X, that way if i1 has been Y"). > Now i1 arrives again (user has pressed some back navigation button say). > Only this time i1 carries slightly different data. Again, this should > affect the server's reaction to a possible i2. Now the previous rule > setting (based on previous i1) for reacting to i2 is outdated, unless > the server updates all affected storage in the server. What if i2 arrives > another time now? Now we're not talking about low level architecture anymore, we're talking about how the app responds to requests, and more specifically about how the application should deal with the 'Back' button. It is a good practice to stamp each generated response so that you could detect the backtracking situation. Once you can detect it, the actions taken will vary. Sometimes you can just unroll the changes done by the first submission, but sometimes other sessions have made use of the modified data, so you need to present an error message. Reards, Wojtek