Skip to content

InterpreterPoolExecutor doesn't respect "thread_name_prefix" #125920

Open
@paultiq

Description

@paultiq

Bug report

Bug description:

InterpreterPoolExecutor takes a thread_name_prefix parameter, but it doesn't propagate to the underlying subinterpreter.

from concurrent.futures import ThreadPoolExecutor
try:
    from concurrent.futures.interpreter import InterpreterPoolExecutor # 3.14+
except ModuleNotFoundError:
    from interpreters_backport.concurrent.futures.interpreter import InterpreterPoolExecutor 

with ThreadPoolExecutor(thread_name_prefix="test_tpe") as tpe_executor:
    tpe_executor.submit(exec, "import threading;print(threading.current_thread().name)")  # 
    
with InterpreterPoolExecutor(thread_name_prefix="test_ipe") as ipe_executor:
    ipe_executor.submit(exec, "import threading;print(threading.current_thread().name)")

Produces

test_tpe_0
Dummy-1

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy