boostorg / boostorg/python

Embedding Python into C++ application in a multi-threaded/concurrent environment?

未关闭
#409 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
537
派生
223
平均合并
11 小时 22 分钟
30 天内合并 PR
2

描述

I am able to use **Boost.Process** to successfully execute a Python script from within a C++ application. The C++ app can obtain the data returned by Python and this is very trivial.

The problem is performance. Creating a new process needed to execute the Python script is very expensive, e.g. 60ms on a mid-level desktop Windows PC. I have not tested on Linux yet but I'm sure that there will still be a performance hit for each process.

Things that have come to mind:

- fastcgi for python
- execute python scripts concurrently in different threads (obviously without creating a new process for each script as I do at this time)

Can **Boost.Python** help me with either of these ideas? I've seen older posts online and people seem to give up with the concurrency method. Please advise, thank you.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。