Home » Developing U++ » U++ Developers corner » SCGI Class
Re: SCGI Class [message #31787 is a reply to message #31781] |
Sun, 27 March 2011 22:51 |
zsolt
Messages: 698 Registered: December 2005 Location: Budapest, Hungary
|
Contributor |
|
|
mirek wrote on Sun, 27 March 2011 10:02 |
Mindtraveller wrote on Sat, 26 March 2011 18:00 |
zsolt wrote on Sat, 26 March 2011 00:55 | BTW it will not solve the problem of long running SQL queries or doing some slow communication in the scgi process.
In such situations you will have to start a lot of scgi processes to be able to handle the traffic.
Increasing that number, just allows the scgi process to have a large backlog.
|
What if in the main cycle the the newly created client socket is processed in another thread while server socket is free to accept more connections?
while (run)
{ if (serverSocket.Accept(&clientSocket)
{
GetThreadFromPoolAndProcess(clientSocket);
}
}
|
Actually, this can be quite nicely with something like
while(run)
{ if (serverSocket.Accept(&clientSocket) {
DoWork();
}
}
and then simply starting several threads to run this loop (with single clientSocket). As accept is reentrant and MT safe, it would return only for single thread running, thus managing the thread pool.
|
This is a very elegant way to solve the problem using threads.
My only problem with MT in situations like this is, that a few things in Upp are global, such as lenguage-dependant setups (e.g. date or number formatting).
It is a common requirement now from a web based app to show content in the user's language, so I think multi process arrangement would be better.
Or is it somehow possible to make these global Upp settings thread local?
|
|
|
|
|
SCGI Class
By: jeremy_c on Tue, 17 August 2010 16:35
|
|
|
Re: SCGI Class
By: zsolt on Wed, 18 August 2010 17:50
|
|
|
Re: SCGI Class
By: jeremy_c on Thu, 19 August 2010 15:32
|
|
|
Re: SCGI Class
By: mirek on Sun, 03 October 2010 20:19
|
|
|
Re: SCGI Class
By: jeremy_c on Mon, 04 October 2010 18:52
|
|
|
Re: SCGI Class
By: mirek on Mon, 04 October 2010 19:12
|
|
|
Re: SCGI Class
By: jeremy_c on Mon, 04 October 2010 19:19
|
|
|
Re: SCGI Class
By: mirek on Mon, 04 October 2010 20:28
|
|
|
Re: SCGI Class
By: jeremy_c on Mon, 04 October 2010 23:54
|
|
|
Re: SCGI Class
By: mirek on Tue, 05 October 2010 00:14
|
|
|
Re: SCGI Class
By: jeremy_c on Tue, 05 October 2010 00:30
|
|
|
Re: SCGI Class
By: mdelfede on Thu, 07 October 2010 17:40
|
|
|
Re: SCGI Class
By: jeremy_c on Fri, 08 October 2010 14:14
|
|
|
Re: SCGI Class
By: mdelfede on Fri, 08 October 2010 15:57
|
|
|
Re: SCGI Class
|
|
|
Re: SCGI Class
By: zsolt on Wed, 16 March 2011 22:06
|
|
|
Re: SCGI Class
|
|
|
Re: SCGI Class
|
|
|
Re: SCGI Class
|
|
|
Re: SCGI Class
By: mirek on Fri, 25 March 2011 18:25
|
|
|
Re: SCGI Class
By: zsolt on Fri, 25 March 2011 22:55
|
|
|
Re: SCGI Class
By: mirek on Fri, 25 March 2011 23:56
|
|
|
Re: SCGI Class
|
|
|
Re: SCGI Class
|
|
|
Re: SCGI Class
By: mirek on Sun, 27 March 2011 09:59
|
|
|
Re: SCGI Class
By: mirek on Sun, 27 March 2011 10:02
|
|
|
Re: SCGI Class
By: zsolt on Sun, 27 March 2011 22:51
|
|
|
Re: SCGI Class
By: mirek on Mon, 28 March 2011 08:54
|
|
|
Re: SCGI Class
By: zsolt on Tue, 29 March 2011 21:27
|
|
|
Re: SCGI Class
By: mdelfede on Sat, 11 February 2012 19:34
|
Goto Forum:
Current Time: Sun May 12 11:18:14 CEST 2024
Total time taken to generate the page: 0.03444 seconds
|