Browse Source

Grammar in user manual

Sergey Lyubka 12 years ago
parent
commit
3984e9f5cc
1 changed files with 9 additions and 8 deletions
  1. 9 8
      UserManual.md

+ 9 - 8
UserManual.md

@@ -443,7 +443,7 @@ Notes:
 
 
 Mongoose is multithreaded web server. `mg_start()` function allocates
 Mongoose is multithreaded web server. `mg_start()` function allocates
 web server context (`struct mg_context`), which holds all information
 web server context (`struct mg_context`), which holds all information
-about the web server instance:
+about web server instance:
 
 
 - configuration options. Note that mongoose makes internal copies of
 - configuration options. Note that mongoose makes internal copies of
   passed options.
   passed options.
@@ -453,26 +453,27 @@ about the web server instance:
 - a queue for accepted sockets
 - a queue for accepted sockets
 - mutexes and condition variables for inter-thread synchronization
 - mutexes and condition variables for inter-thread synchronization
 
 
-When `mg_start()` returns, all initiazation is quaranteed to be complete
-(e.g. listening ports are opened, SSL is initialized). `mg_start()` starts
+When `mg_start()` returns, all initialization is quaranteed to be complete
+(e.g. listening ports are opened, SSL is initialized, etc). `mg_start()` starts
 two threads: a master thread, that accepts new connections, and several
 two threads: a master thread, that accepts new connections, and several
 worker threads, that process accepted connections. The number of worker threads
 worker threads, that process accepted connections. The number of worker threads
 is configurable via `num_threads` configuration option. That number puts a
 is configurable via `num_threads` configuration option. That number puts a
 limit on number of simultaneous requests that can be handled by mongoose.
 limit on number of simultaneous requests that can be handled by mongoose.
 
 
-When master thread accepts new connection, accepted socket (described by
+When master thread accepts new connection, a new accepted socket (described by
 `struct socket`) it placed into the accepted sockets queue,
 `struct socket`) it placed into the accepted sockets queue,
 which has size of 20 (see [code](https://github.com/valenok/mongoose/blob/3892e0199e6ca9613b160535d9d107ede09daa43/mongoose.c#L486)). Any idle worker thread
 which has size of 20 (see [code](https://github.com/valenok/mongoose/blob/3892e0199e6ca9613b160535d9d107ede09daa43/mongoose.c#L486)). Any idle worker thread
-can grab accepted sockets from that queue. If all worker threads are busy
-mongoose can accept and queue 20 more TCP connections, filling the queue.
-In the attempt to queue next accepted connection, master thread will block
+can grab accepted sockets from that queue. If all worker threads are busy,
+master thread can accept and queue up to 20 more TCP connections,
+filling up the queue.
+In the attempt to queue next accepted connection, master thread blocks
 until there is space in a queue. When master thread is blocked on a
 until there is space in a queue. When master thread is blocked on a
 full queue, TCP layer in OS can also queue incoming connection.
 full queue, TCP layer in OS can also queue incoming connection.
 The number is limited by the `listen()` call parameter on listening socket,
 The number is limited by the `listen()` call parameter on listening socket,
 which is `SOMAXCONN` in case of Mongoose, and depends on a platform.
 which is `SOMAXCONN` in case of Mongoose, and depends on a platform.
 
 
 Worker threads are running in an infinite loop, which in simplified form
 Worker threads are running in an infinite loop, which in simplified form
-look something like this:
+looks something like this:
 
 
     static void *worker_thread() {
     static void *worker_thread() {
       while (consume_socket()) {
       while (consume_socket()) {