Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Memory Access Violation - Python Net 3.0.2 - Multi-threaded Dot Net application#2444

Unanswered
crazyoutlook asked this question inQ&A
Discussion options

Environment

  • Pythonnet version: 3.0.2
  • Python version: 3.10
  • Operating System: Windows Server 2019 Datacenter
  • .NET Runtime: 6.0

Details

  • Describe what you were trying to get done.

Running multi-threaded process in Dot net using Pythonet. I have a dot net application which used Pythonnet to invoke some python methods. As long as I am running single threaded process of my application it works fine. When I run multi-threaded application then I am getting error in Pythonnet.

Fatal error. System.AcccessViolationExcepriom: Attempted to read or write protected memory. This is often an indication that other memory is corrupt:
at Python.runtime.Runtime.PyErr_Clear()
at Python.runtime.Exception.PyErr_Clear()
at Python.Runtime.PythonEngine,Initialize(System.Collection.Generic.IEnumerable 1<System.String>

Running multi-threaded process in Dot net using Pythonet.

  • If there was a crash, please include the traceback here.

Fatal error. System.AcccessViolationExcepriom: Attempted to read or write protected memory. This is often an indication that other memory is corrupt:
at Python.runtime.Runtime.PyErr_Clear()
at Python.runtime.Exception.PyErr_Clear()
at Python.Runtime.PythonEngine,Initialize(System.Collection.Generic.IEnumerable 1<System.String>

You must be logged in to vote

Replies: 2 comments

Comment options

Hello Team, please guide me with this issue, provide some insights on how to resolve this issue. Can we do multithreading? As of now I am using SINGETON class to create only 1 object of python net. And I am using that object to make all AI Model calls.

You must be logged in to vote
0 replies
Comment options

同样遇到了这个问题,多线程能力弱鸡

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@crazyoutlook@tabs
Converted from issue

This discussion was converted from issue #2443 on September 10, 2024 09:48.


[8]ページ先頭

©2009-2025 Movatter.jp