首页 \ 问答 \ 如果线程正在等待监视器在同步块之前被释放,或者它调用wait()(is there any difference if thread is waiting for monitor to be freed before synchronized block or if it calls wait())

如果线程正在等待监视器在同步块之前被释放,或者它调用wait()(is there any difference if thread is waiting for monitor to be freed before synchronized block or if it calls wait())

我已经阅读了许多关于线程状态的文档,其中一些告诉我们有两种不同的状态:阻塞(在同步之前)和等待(如果呼叫在等待),其他一些人说只有一个状态:等待。 此外,一些文档告诉你应该为每个wait()调用notify(),并且如果你不这样做,那么即使监视器被解锁,线程waiting()也永远不会被执行。


I've read many docs about thread states, some of them tells that there is two different states: blocked (before synchronized) and wait (if calls wait), some others are telling that there is only one state: wait. Moreover, some docs telling that you should call notify() for every wait() and if you don't then threads waiting() will never be eligible for execution even if monitor is unlocked.


原文:https://stackoverflow.com/questions/3872606
更新时间:2024-03-11 20:03

最满意答案

查找这些资源的常用技巧是使用浏览器中运行的开发人员网络工具打开Admin界面,然后导航到您正在查找的资源,同时查看浏览器执行的请求。 由于前端纯粹基于Javascript并在浏览器中运行,因此它通过Solr公开的API访问所有内容。

您必须以JSON或XML(可能)格式解析某些内容 。 对于我的旧版4.10.2安装,它可用作:

/solr/corename/admin/file?file=schema.xml&contentType=text/xml;charset=utf-8

The usual trick for finding these resources it to open the Admin interface with the developer network tool running in your browser, then navigating to the resource you're looking for while watching which requests your browser perform. Since the frontend is purely Javascript based and runs in your browser, it accesses everything through the API exposed by Solr.

You'll have to parse something, either in JSON or XML (probably) format. For my older, 4.10.2-installation, it is available as:

/solr/corename/admin/file?file=schema.xml&contentType=text/xml;charset=utf-8

相关问答

更多
  • 不幸的是,在撰写本文时这是一个悬而未决的问题 ,实施它似乎并没有太大的兴趣。 正如评论中所建议的,您可以通过设置一些外部连接(如WebDAV,FTP,SFTP,SCP)来解决此问题。 Unfortunately that's an open issue as of this writing, and there doesn't seem to be much interest to implement it. As suggested in the comments you can work around ...
  • 这些DB服务器的用途不同,它在很大程度上取决于您的应用程序(以及您存储的数据类型)是否应该仅使用Solr或MySQL。 MySQL可以很好地存储具有大量关系和表格的数据(彼此相关的表格)。 Solr很适合文本搜索(正如你所说:快速索引),如果你没有很多“相关数据”,你确实可以将这些数据存储在相同的文档中。 有些人确实只使用Solr来存储他们的数据库...但我仍然认为RDBM可以很好地用于某些类型的数据。 例如:如果您想允许快速搜索系统用户并存储他们的完整个人资料,以及一些信息详细信息......最好使用So ...
  • ES已经为此进行了渗透 - 对于Solr,您通常会将文档索引为基于内存的核心/索引中的单个文档,然后针对该文档运行查询(这是ES至少在内部执行的操作,IIRC)。 ES has percolate for this - for Solr you'll usually index the document as a single document in a memory based core / index and then run the queries against that (which is wha ...
  • 挣扎几个小时后,我终于得到了一些东西。 不完美,但足够好。 根据这篇文章: http : //alexbenedetti.blogspot.fr/2015/07/solr-you-complete-me.html 我使用了FreeTextLookupFactory 我的search_indexes.py class ArticleIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=Tru ...
  • 查找这些资源的常用技巧是使用浏览器中运行的开发人员网络工具打开Admin界面,然后导航到您正在查找的资源,同时查看浏览器执行的请求。 由于前端纯粹基于Javascript并在浏览器中运行,因此它通过Solr公开的API访问所有内容。 您必须以JSON或XML(可能)格式解析某些内容 。 对于我的旧版4.10.2安装,它可用作: /solr/corename/admin/file?file=schema.xml&contentType=text/xml;charset=utf-8 The usual tri ...
  • 您需要考虑对搜索查询有意义的内容,但有一些规则。 第一个要求是唯一键需要具有相同的名称,并且在集合中是唯一的,否则Solr无法整理结果。 如果您希望获得某种合理的结果排名,则需要一些常见的字段 。 例如,我有两个集合:一个是产品数据,另一个是包含产品相关文档。 我有一个唯一的密钥: id和我有共同的标题和内容字段 ,当我想要查询两个集合时。 我还有一个高级搜索界面,我可以在其中查询产品ID等特定字段。 “统一核心”是跨两个或多个核心处理搜索的典型方式,请参阅此Stack Overflow答案,了解如何设置 ...
  • 您在每个查询中都给出了参数rows=2147483647 。 该参数的含义是(取自参考文献) 您可以使用rows参数对查询中的结果进行分页。 该参数指定Solr应一次返回客户端的完整结果集中的最大文档数。 默认值为10.也就是说,默认情况下,Solr一次返回10个文档以响应查询。 因此,您告诉Solr生效,在单个响应中发送查询的所有匹配。 这是你糟糕表现的原因。 当查询“java”时 ,谷歌是否会向您发送所有500.000.000次匹配,不会。 为什么不,性能。 我知道的每一个IR应用程序都会为您提供一个带 ...
  • 为了自己解决这个问题:我找不到托管模式复制的解决方案,所以我用schema.xml切换到静态模式,现在一切都很好。 To anwer it on my own: I've found no solution for replication of managed schema, so I switched to static schema with schema.xml and all is fine now.
  • 查看本手册,了解SOLR中的布尔运算符 http://robotlibrarian.billdueber.com/solr-and-boolean-operators/ check this manual, for using Boolean operators in SOLR http://robotlibrarian.billdueber.com/solr-and-boolean-operators/
  • 问题出在您的查询语法中。 请参阅Lucene查询语法文档中的此示例。 你的查询是: name_de:welcher German welcher 只会在name_de中搜索第一个查询字词。 其余的将在默认字段(名称)中搜索。 你的查询是有效的: name_de:welcher name:German name:welcher 相反,尝试: name_de:(welcher German welcher) The problem is in your query syntax. See this exa ...

相关文章

更多

最新问答

更多
  • 获取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的基本操作命令。。。