如何冻结一个内存块或使其看起来像冻结的? [英] How to freeze a memory block or make it looks like frozen?

查看:139
本文介绍了如何冻结一个内存块或使其看起来像冻结的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个内存块中我已经找到地址的数据总是在变化,我希望它不变化.如何用Visual C ++,多线程或...来实现它?代码会没事的.谢谢! :):rose:

The data in one memory block whose address I have already found is always changing, and I want it not changed. How to realise it with Visual C++, multi-thread or ...? Code will be fine. Thanks! :) :rose:

推荐答案

您要通过阻止更改内存内容来尝试做什么?
What are you trying to do by preventing changes to memory contents?


应用程序的源代码,问题出在线程同步(看起来像)上,添加适当的同步保护(例如互斥锁).
:)
If you have all the source code of the application and the problem is about thread synchronization (it looks like) add the proper synchronization guards (for instance a mutex).
:)


如果您不想更改某些内容,可以将其声明为const变量.但是,我确实不知道您到底是什么问题.

使用此页面底部的留言板(单击新帖子")进行更多说明,或通过单击改进问题"来编辑原始查询.
If you do not want to change something, you could declare it as a const variable. However, I do really have no idea of what exactly your problem is.

Use the message board at the bottom of this page (click "new post") to give more clarification, or edit your original query by clicking "improve question".


这篇关于如何冻结一个内存块或使其看起来像冻结的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆