首页 \ 问答 \ 轮询,选择并“将阻止”(poll, select and “would block”)

轮询,选择并“将阻止”(poll, select and “would block”)

我正在学习关于pollselect和类似的功能,而且我一直很担心陈述“会阻止”(在我正在阅读的关于为Linux构建驱动程序以及在pollselect手册页上阅读的这本书中)。 我真的不明白这一点。 什么会被阻止? 读/写文件描述符的过程? 读/写操作本身,就是说当前进程正在读/写时,没有其他进程能够读/写该文件?

如果这是一个愚蠢的问题,我很抱歉,但我很难在任何地方找到这个问题的答案。


I am learning about poll, select and similar functions and I am constantly bothered by the statement "would block" (which shows up both on the book I am reading about building drivers for Linux and also on the man pages of poll and select). I don't really get this. What would be blocked? The process which is reading/writing to a file descriptor? The reading/writing operation itself, in the sense that no other process would be able to read/write to that file when the current process is reading/writing on it?

I am sorry if this is a stupid question but I am having a difficult time finding the answer for this question anywhere.


原文:https://stackoverflow.com/questions/12568412
更新时间:2023-08-30 07:08

最满意答案

如果它是自然生成的,你可以将slug反向映射到相应的ID,只要记住这一点:

在增加你的ID变量之前,你可以确保它增加的条目还没有被输入与该ID相对应的slug的人填充,如果这种情况只是不断增加ID列直到你找到一个新的唯一值。


You could do the reverse mapping of the slug to the corresponding ID it would occupy if it was naturally generated, just keep this in mind:

Before increasing your ID variable you can make sure the entry it would increase to is not already populated by someone who entered a slug which corresponds to that ID, if that's the case just keep incrementing the ID column until you find a new unique value.

相关问答

更多
  • 维基是你的朋友 基本上,使用较短名称的网站作为占位符,例如bit.ly。 然后,bit.ly生成用户提供的密钥,随机生成的密钥不重复。 有35个字符选项和8个左右的值,做数学。 这是很多可能的钥匙。 如果一个url等于之前存在的密钥,那么我记得在某个地方阅读他们重用的密钥。 他们并不真正使用特定的编程语言,他们只是使用一个简单的URL重定向,这可以用我相信的HTML来完成。 Wiki Is Your Friend Basically, a website with a shorter name is use ...
  • 我一直都做错了。 正确的方法是创建Credential对象并使用setAccessToken()方法设置Access令牌。 public static Urlshortener newUrlshortener() { Credential credential = new Credential(); credential.setAccessToken("{accessToken}"); return new Urlshortener.Builder(new UrlFetchTran ...
  • 我相信那些都是相对的。 因为day是请求时间前24小时。 我刚刚在上午10:45点击缩短的网址进行了快速测试,点击立即显示在图表上。 I believe those are are all relative. As in day is the 24 hours leading up to the time of the request. I just did a quick test by clicking on a shortened URL at 10:45am and the click showed ...
  • 最后,如果你是一个简短的链接,你只需要生成一个适当易读的唯一代码(尝试省略类似的字母/数字,如零和'o',以防一些可怜的bugger实际上必须输入它)和关联在某种形式的商店中使用原始URL的代码。 虽然我可以理解为什么你不想使用数据库,但在很多方面它都是完美的存储形式,特别是如果你看一个专用的键/值存储,如Cassandra , Redis , MongoDB等。如果你处于一个不熟悉的领域,一个简单的“传统”SQL数据库可能是一个简单的第一步。) Ultimately if you're after a s ...
  • 如果它是自然生成的,你可以将slug反向映射到相应的ID,只要记住这一点: 在增加你的ID变量之前,你可以确保它增加的条目还没有被输入与该ID相对应的slug的人填充,如果这种情况只是不断增加ID列直到你找到一个新的唯一值。 You could do the reverse mapping of the slug to the corresponding ID it would occupy if it was naturally generated, just keep this in mind: Bef ...
  • 你意思是? RewriteEngine On RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ /(index\.php)?\?id=([0-9]+)([^\ ]*) RewriteRule ^ /%3?%4 [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([0-9]+)/?$ /?id=$1 [L,QSA] You mean? ...
  • 您完全正确:为此,Google需要将您的应用添加到他们的apple-app-site-association文件中。 不幸的是,即使Google 想要这样做也是不可能的,因为Apple在该文件上设置了128 kb的大小限制。 集成App Indexing SDK是一个很好的想法,但也没有解决这个问题。 你需要的是像Branch.io这样的(免费)服务(完全披露:我在分支团队中)。 这是专为您正在尝试完成的工作而设计的,并负责您遇到的所有内务处理任务。 您将能够创建品牌短URL,将您带到您的应用程序(如果已安 ...
  • 基本上,支持bit.ly和其他URL缩短程序的应用程序可以告诉您自己是谁,从而使用自定义域适当缩短URL。 Basically, apps that are supporting bit.ly and other URL shorteners can tell who you are and thus shorten the URL appropriately using a custom domain.
  • 您可以使用URI模块 ,然后使用正则表达式来解析第一个www。 喜欢 def host(url) uri = URI.parse(url) uri.host.sub(/^www./, '') end You can use the URI module and then use a regexp to parse out the first www. Like def host(url) uri = URI.parse(url) uri.host.sub(/^www./, ...
  • 您询问的脚本就在那里,因此您可以从该页面快速创建短URL。 提示将询问您要缩短的URL,而第二个会自动缩短您已经使用的页面。 给他们一个去:) The scripts you're asking about are there so you can quickly create a Short URL from that page. The prompt will ask you what URL you want to shorten, whilst the second one will automat ...

相关文章

更多

最新问答

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