Skip to content

Commit a1a2973

Browse files
author
Fabien Coelho
committed
enhance discussion in README
1 parent 584ac04 commit a1a2973

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ Shared.init_app("hello world!")
186186

187187
## Notes
188188

189-
This module is rhetorical: because of the GIL Python is quite bad as a parallel
190-
language, so the point of creating threads which will mostly not really run in
191-
parallel is moot, thus the point of having a clever pool of stuff to be shared
192-
by these thread is even mooter! However, as the GIL is scheduled to go away
193-
in the coming years, starting from _Python 3.13_, it might start to make sense
194-
to have such a thing here!
189+
This module was initially rhetorical: because of the GIL Python was very bad as
190+
a parallel language, so the point of creating threads which would mostly not
191+
really run in parallel was moot, thus the point of having a clever pool of
192+
stuff to be shared by these thread was even mooter!
193+
However, as the GIL is scheduled to go away in the coming years, starting from
194+
_Python 3.13_ (Fall 2024), it is startng to make sense to have such a thing!
195195

196196
In passing, it is interesting to note that the foremost
197197
[driving motivation](https://peps.python.org/pep-0703/) for getting
@@ -219,7 +219,18 @@ See Also:
219219
- [Eventlet db_pool](https://eventlet.net/doc/modules/db_pool.html)
220220
for pooling MySQL or Postgres database connexions.
221221
- [Discussion](https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing)
222-
about database pool sizing (spoiler: small is beautiful).
222+
about database pool sizing (spoiler: small is beautiful: you want threads
223+
waiting for expensive resources used at full capacity rather than
224+
many expensive resources under used).
225+
226+
Example of resources to put in a pool: connections to databases, authentication
227+
services (eg LDAP), search engine…
228+
229+
For a typical REST backend, most requests will require one DB connection, thus
230+
having an in-process pool with less connections is not very usefull, and more is
231+
useless as well, so we may only have _#conns == #threads_ which make sense.
232+
The only point of having a pool is that the thread may be killed independently
233+
and avoiding recreating connections in such cases.
223234

224235
## License
225236

0 commit comments

Comments
 (0)