Skip to content

多线程中,数据从cpu拷贝到内存中,出现写入冲突 #3498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yangy996 opened this issue May 7, 2025 · 2 comments
Open

多线程中,数据从cpu拷贝到内存中,出现写入冲突 #3498

yangy996 opened this issue May 7, 2025 · 2 comments
Labels
question Further information is requested

Comments

@yangy996
Copy link

yangy996 commented May 7, 2025

Image

@jxt1234 jxt1234 added the question Further information is requested label May 9, 2025
@jxt1234
Copy link
Collaborator

jxt1234 commented May 9, 2025

完整运行代码是什么?

@yangy996
Copy link
Author

yangy996 commented May 9, 2025

完整运行代码是什么?

c++中,初始化多个class对象,比如4个,外部开启多线程调用,每个线程随机获取一个对象,获取到对象后,该线程独占对象,并通过该对象调用class中的方法。
一个进程的时候,或者给进程加锁,都没什么问题,一旦进程过多,实测超过10,必会出现上面的内存报错问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants