Outils pour utilisateurs

Outils du site


tech:notes_python_multithreading

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:notes_python_multithreading [2025/05/13 15:30] Jean-Baptistetech:notes_python_multithreading [2025/05/20 17:51] (Version actuelle) Jean-Baptiste
Ligne 12: Ligne 12:
 * https://pypi.org/project/pygolang/ * https://pypi.org/project/pygolang/
 * https://pypi.org/project/python-defer/ * https://pypi.org/project/python-defer/
 +
 +
 +Thread safe :
 +* https://plainenglish.io/blog/thread-safety-in-python
 +* https://jonbleiberg.medium.com/how-python-keeps-your-queues-thread-safe-4b66a2f3e692
 +
 +
  
 Nombre de CPU logiques Nombre de CPU logiques
Ligne 295: Ligne 302:
 Source : https://stackoverflow.com/questions/56318648/how-to-run-an-asyncio-task-without-awaiting Source : https://stackoverflow.com/questions/56318648/how-to-run-an-asyncio-task-without-awaiting
  
 +Thread safe 
 +
 +<code python>
 +from collections import deque
 + 
 +thread_safe_deque = deque()
 + 
 +# Thread 1
 +thread_safe_deque.append(1)
 + 
 +# Thread 2
 +element = thread_safe_deque.pop()
 +</code>
 +
 +
 +Source : https://www.cloudthat.com/resources/blog/writing-thread-safe-programs-in-python
  
 --------- ---------
tech/notes_python_multithreading.1747143000.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki