首页 \ 问答 \ 如何更改CPU缓存的关联性?(How do you change the associativity of the CPU cache?)

如何更改CPU缓存的关联性?(How do you change the associativity of the CPU cache?)

我想收集不同缓存关联性设置的L2缓存未命中数据。 任何人都可以告诉我如何改变相关性? 在x86_64 Intel Core2 duo CPU上使用Ubuntu


I'd like to collect data of L2 cache misses for different cache associativity settings . can anybody tell me how i could change the assocoiativity ? uSing Ubuntu on x86_64 Intel Core2 duo CPU


原文:https://stackoverflow.com/questions/3358972
更新时间:2023-06-08 19:06

最满意答案

根据设计,Actionscript是一种事件驱动语言。 它还保证代码在单个线程中执行,即如果函数调用开始,则在第一次调用完成之前不会执行其他(新调用)actionscript代码。

话虽这么说,你应该拥有的是将完整的处理程序传递给sql(...)。

function sql(saveorload:String, sqlstring:String, completeHandler:Function):void
{
    var sqlloader = new URLLoader();
    var sqlrequest = new URLRequest("http://***/sql.php");
    sqlrequest.method = URLRequestMethod.POST;
    sqlloader.addEventListener(Event.COMPLETE, completeHandler);//tell urlloader to use the complete handler passed in parameters    
    var variables:URLVariables = new URLVariables();
    variables.sqlm = saveorload;
    variables.sqlq = sqlstring;
    sqlrequest.data = variables;

    sqlloader.load(sqlrequest);
}

然后从其他地方使用它,例如:

sql("1","SELECT * FROM songs WHERE `flag2` LIKE '0'", sqldonetrace);
function sqldonetrace(e:Event)
{
    var sqldata:String = e.target.data;
    trace (sqldata);
}

另外,我认为你应该检查来自urlloader的错误事件。 将另一个参数作为errorHandler传递给sql


Actionscript is, by design, an event driven language. It also guarantees that the code executes in a single thread i.e. if a function call starts, no other(new call) actionscript code would execute until the first call finishes.

That being said, what you should have is to pass a complete handler to sql(...).

function sql(saveorload:String, sqlstring:String, completeHandler:Function):void
{
    var sqlloader = new URLLoader();
    var sqlrequest = new URLRequest("http://***/sql.php");
    sqlrequest.method = URLRequestMethod.POST;
    sqlloader.addEventListener(Event.COMPLETE, completeHandler);//tell urlloader to use the complete handler passed in parameters    
    var variables:URLVariables = new URLVariables();
    variables.sqlm = saveorload;
    variables.sqlq = sqlstring;
    sqlrequest.data = variables;

    sqlloader.load(sqlrequest);
}

And then use it from some other place like:

sql("1","SELECT * FROM songs WHERE `flag2` LIKE '0'", sqldonetrace);
function sqldonetrace(e:Event)
{
    var sqldata:String = e.target.data;
    trace (sqldata);
}

Also, I think you should check for error events from urlloader. Pass another parameter to sql as errorHandler

相关问答

更多
  • 根据设计,Actionscript是一种事件驱动语言。 它还保证代码在单个线程中执行,即如果函数调用开始,则在第一次调用完成之前不会执行其他(新调用)actionscript代码。 话虽这么说,你应该拥有的是将完整的处理程序传递给sql(...)。 function sql(saveorload:String, sqlstring:String, completeHandler:Function):void { var sqlloader = new URLLoader(); var sql ...
  • 像这样改变它: var stats:Object = {}; for(var i:Number=1; i<=90; i++) { if(myLoader.data["st"+i]){ stats["st"+i] = myLoader.data["st"+i]; trace("st"+ i + " is: "+stats["st"+i]); } } 请注意语法: myLoader.data["st"+i]而不是myLoader.data."st"+i Change it like t ...
  • 首先,由于load方法是异步的,因此代码中的这三个调用将相继覆盖。 唯一会导致COMPLETE事件被调度的调用将是最后一个调用。 如果要异步加载文件,则需要为每个文件创建一个URLLoader实例。 其次,(更重要的是你的问题) URLLoader类中没有属性允许你访问load()最初被调用的URLRequest 。 一个简单的方法是扩展URLLoader 。 例如,如果你只需要网址: public class MyURLLoader extends URLLoader { private var ...
  • 很久以前,当我试图加载大量图像时,我遇到了这个问题。 他们都是本地的,所以我只是用装载机排队。 队列小时调试图像为空的原因:S 我不确定是否在任何地方提到限制,但我发现(如果记忆服务)30左右就给我带来了问题。 在那之后,我认为它将重用旧的连接:所以如果你有100个load()调用,只会加载最后30个左右。 通常我一次排队大约10,然后在完成后加载其余的。 多个连接没有真正的问题 - 尽管它们会开始占用CPU功率等。 如果您想忽略这一点,请查看BulkLoader之类的内容:为此创建的http://code ...
  • 问题在于从服务器检索的数据/文本。 它充满了反斜杠。 虽然它直接在代码中编写文本时可以很好地作为转义字符,但它不应该在检索的数据中。 Problem is with the retrieved data/text from the server. It is full of backslashes. While it works well as an escape character when writing text directly in the code, it is not supposed to ...
  • 我之前做过那个..你可以从这里查看我的博客文章,也许它可以帮助你。 我在服务器端使用Java,而不是CF. I did that a some time ago..you can check my blog post from here, maybe it can help you. I was using Java on the server side, not CF.
  • 实际上,在发布此问题后,我认为它可能由URLRequest而不是URLLoader处理。 它是: URLRequest.manageCookies 那么,回答我自己的问题: 是的,它是自动管理它们。 是的,它可以通过适当命名的manageCookies属性进行管理。 Actually, just after posting this question I thought that it may be handled by URLRequest and not URLLoader. It is: URLReq ...
  • 我认为只是你的Main类应该从MovieClip延伸而不是Sprite : public class Main extends MovieClip { // ... } 要在浏览器中调试项目,您可以使用可从此处下载的Flash播放器调试版本。 希望能有所帮助。 I think that simply your Main class should extend from MovieClip and not Sprite : public class Main extends MovieClip ...
  • 是的,URLLoader缓存请求,并且有各种解决方案来中断缓存请求(通常通过在Web请求的末尾添加随机元素)。 您可以在此处查看返回的URLRequest对象的文档 ,以及各种缓存选项。 但是,我建议在收到请求并使用您所在的平台数据库/数据存储模式后在本地保留数据。 然后,在发出请求之前检查Internet:如果可以建立连接,请发出请求以检索和更新本地数据。 如果没有互联网/连接,只需加载您在本地保存的数据。 使用请求的“缓存”版本不是值得信赖的模式。 Yes, the URLLoader caches r ...
  • 如果没有加载任何内容, URLLoader.close()会导致问题吗? 是的,它确实。 来自URLLoader.close()的livedocs页面 正在进行的任何加载操作都会立即终止。 如果当前没有流式传输URL,则会引发无效的流错误。 显然你没有使用Flash播放器的调试版本,因此没有看到错误被抛出。 Flash播放器的调试版本是Flash / Flex开发人员必备的。 如果你在try块中调用close()并捕获错误,你可以看到发生了什么。 try { myLoader.close(); } c ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。