From 3394bec36443e8b5b8f2cb10300076ea4eccf91a Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Mon, 27 Sep 2021 15:52:16 +0530 Subject: [PATCH] docs(python): add docs about threading (#8829) Co-authored-by: Max Schmitt --- docs/src/intro-python.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/src/intro-python.md b/docs/src/intro-python.md index fcb34d6264..7c9fc94dec 100644 --- a/docs/src/intro-python.md +++ b/docs/src/intro-python.md @@ -189,6 +189,11 @@ Playwright runs the driver in a subprocess, so it requires `ProactorEventLoop` o On Windows Python 3.7, Playwright sets the default event loop to `ProactorEventLoop` as it is default on Python 3.8+. +### Threading + +Playwright's API is not thread-safe. If you are using Playwright in a multi-threaded environment, you should create a playwright instance per thread. See [threading issue](https://github.com/microsoft/playwright-python/issues/623) for more details. + + ## System requirements Playwright requires Python 3.7 or above. The browser binaries for Chromium,