interruptible是什么意思,interruptible中文翻譯,interruptible發(fā)音、用法及例句
?interruptible
interruptible發(fā)音
[.intə'rʌpt]
英: 美:
interruptible中文意思翻譯
中斷
interruptible詞形變化
形容詞: interruptible | 動(dòng)詞過(guò)去分詞: interrupted | 動(dòng)詞第三人稱(chēng)單數: interrupts | 動(dòng)詞現在分詞: interrupting | 名詞: interruption | 動(dòng)詞過(guò)去式: interrupted |
interruptible常見(jiàn)例句
1 、Be quiet! It's rude to interrupt people when they are speaking.───安靜!打斷別人講話(huà)是粗暴無(wú)禮的。
2 、It s very impolite to interrupt such a formal seminar.───在這么正式的研討會(huì )里**嘴是很不禮貌的。
3 、Could not initialize the interrupt controller.───不能初始化中斷控制器。
4 、Don't interrupt the editor. He is looking out for mistakes.───別打擾那編輯,他在查找錯誤。
5 、Survivin act on Caspase, and interrupt the process of apoptosis.───Survivin直接作用于Caspase,阻斷細胞的凋亡過(guò)程。
6 、Don't interrupt the speaker; ask your questions afterwards.───不要打斷那位講話(huà)的人,等一會(huì )再問(wèn)你的問(wèn)題。
7 、His speech was interrupt ceaselessly by hurrah.───他的演講不停地被歡呼聲打斷.
8 、The address of an interrupt service routine.───中斷服務(wù)程序所在的地址。
9 、It is not polite to interrupt a speaker with frequent questions.───不斷提問(wèn)打斷演講者是不禮貌的。
10 、Figure 4-2. Interrupt priority in action.───圖4-2。在這個(gè)動(dòng)作中的中斷優(yōu)先。
11 、There is a interrupt conflict at interrupt number %3.───中斷號%3產(chǎn)生中斷沖突。
12 、It is not polite to interrupt when someone is talking.───在別人講話(huà)時(shí)**嘴是不禮貌的。
13 、Too many examples can interrupt the smooth flow of the text.───例子太多會(huì )使行文不流暢。
14 、Maim, Bash and Pounce are all stuns and never interrupt players.───割碎、猛擊與偷襲對玩家都是只能昏迷而不打斷。
15 、Please don't hesitate to interrupt.───如果有問(wèn)題,請別客氣,盡管打斷我。
16 、Not at all. It's efficient, no interruptions.─── 并不是 這樣很有效率 也不會(huì )被打擾
17 、Care must be taken not to interrupt the timing wave.───如果需要精確定時(shí),必須注意不要中斷定時(shí)波。
18 、Don't interrupt John, he's grappling with the accounts.───別打擾約翰,他正在聚精會(huì )神地算帳呢。
19 、Don't interrupt her, let her have her say.───別打斷她,讓她把意見(jiàn)說(shuō)出來(lái)。
20 、No. Interrupting me while I was having a conversation.─── 不 是在我說(shuō)話(huà)的時(shí)候 打斷我而死
21 、Man,it really pisses me off when people interrupt me like that.───哼,如果我被別人那樣打斷的話(huà),我就會(huì )特別生氣。
22 、Don't interrupt; just hear me out.───別打岔, 聽(tīng)我說(shuō)完。
23 、The Intel interrupt handling code is in arch/i386/kernel/irq.───Intel系統的中斷處理代碼位于arch/i386/kernel/irq.
24 、You have to interrupt someone and put forward your own opinion.───你不得不打斷別人,以表述自己的見(jiàn)解。
25 、Never interrupt when someone is complimenting you.───不要打斷別人對你的夸獎。
26 、Don't interrupt or chime in.───不要打斷他(她),不要**話(huà)。
27 、Don't interrupt them; they're talking business.───他們在談?wù)?jīng)事兒,別打岔。
28 、Don't interrupt him; he's talking sense.───別打斷他的話(huà);他談得蠻有道理。
29 、People will interrupt you less.───人們會(huì )更少打斷你。
30 、Mr Harmsworth,don't interrupt.───哈姆斯伍斯,別打斷我的話(huà)。
31 、Don't interrupt while we are rehearsing.───(我們)排戲期間,請勿打擾。
32 、Don't interrupt her: let her have her say.───別打斷她的話(huà),讓她把意見(jiàn)說(shuō)出來(lái)。
33 、It is rude to interrupt when someone else is speaking.───在別人說(shuō)話(huà)時(shí)**嘴是無(wú)禮的。
34 、Don't interrupt me, children.───孩子們,別打斷我的話(huà)。
35 、Do not interrupt me when I am on a roll.─── *得正順利的時(shí)候不要打斷我
36 、Excuse me,can i interrupt you?───可以打擾您一下嗎?
37 、Don't interrupt me; we are talking about an important matter.───不要打斷我的話(huà),我們正在談?wù)撘患匾氖虑椤?/p>
38 、Shh. Please don't interrupt, Amy.───噓,不要搗亂,艾米。
39 、The sudden noise from the next room interrupt my train of think.───從隔壁房間突然傳來(lái)的鬧聲打斷了我的思路。
40 、Don't Interrupt Periods Of Silence.───不要在沉默時(shí)**話(huà)。
41 、I don't think so. Interrupted, then.─── 我不這么覺(jué)得 那肯定是被人打斷了
42 、Interruptible load is an important tool in demand side management,it also can be employed for congestion management.───可中斷負荷作為需求側管理的重要手段,可以有效地緩解阻塞。
43 、Trade between the two countries are interrupt by the war.───兩國間貿易因戰爭而中斷。
44 、You'd better not interrupt him. He is sleeping.───你最好別打擾他, 他在睡覺(jué)。
45 、Don't interrupt me while I'm busy.───在我忙的時(shí)候,不要打擾我。
46 、Card %2: Timed out waiting for free cells interrupt.───卡%2:等待可用單元中斷時(shí)超時(shí)。
47 、Do not interrupt your father in his talk .───不要打斷你父親的談話(huà)。
48 、She never lets ideas interrupt the easy flow of conversation.───她說(shuō)起話(huà)來(lái)滔滔不絕,卻沒(méi)有思想。
49 、You're interrupting me, I wasn't done yet.─── 你打斷我了 我還沒(méi)說(shuō)完
50 、He is now drowned in sleep. Don't interrupt him.───他現在正在酣睡之中,別打擾他。
51 、We will take our cue from your nodding, then interrupt the meeting.───你點(diǎn)點(diǎn)頭我們就去打斷會(huì )議。
52 、Don't interrupt a speaker. It's impolite.───不要打斷別人說(shuō)話(huà),這不禮貌。
53 、If people often interrupt, your tempo may be too slow or halting.───如果人們總是打斷你,你的語(yǔ)速就顯得太慢或猶疑不決。
54 、If you interrupt again, I'll have you removed.─── 如果你再打岔的話(huà) 我就要請你出去了
55 、I hate to interrupt a man when he' s busy working.───一個(gè)人忙于工作時(shí),我最不愿打攪了。
56 、In communications, to interrupt the sending end and take control of the circuit at the receiving end.───在通信技術(shù)中,中斷發(fā)送端的發(fā)送,并在接收端取得電路的控制權。
57 、Children must learn not to interrupt.───兒童應學(xué)會(huì )不要打斷別人的講話(huà)。
58 、He ventured at the dinner-table to interrupt Dr. Middleton once.───他竟斗膽在飯桌旁打斷了一次彌得爾頓博士的談話(huà)。
59 、You shouldn't interrupt when others are talking.───別人說(shuō)話(huà),你別**嘴。
60 、Don't interrupt herlet her have her say.───別打斷她的話(huà),讓她把意見(jiàn)說(shuō)出來(lái).
61 、What I was telling you before you interrupted me.─── 你打斷我之前我在跟你說(shuō)的事
62 、Do not interrupt me while I am busy .───在我忙的時(shí)候,不要打擾我。
63 、To interrupt or change an operation while in process.───在處理過(guò)程中中斷或改變某一操作。
64 、An Englishman would interrupt a war to have his afternoon tea.───一個(gè)英國人會(huì )中斷一次戰爭去吃他的下午茶。
65 、Gravid nettle rash has inside 4 months, should interrupt gravid.───妊娠4個(gè)月內患風(fēng)疹,應中斷妊娠。
66 、You may use this style for interrupt service routines.───你可以把這種方法用于中斷服務(wù)程序。
67 、They would interrupt and encumber me.───他們會(huì )妨礙我,打攪我。
68 、Do not interrupt the speaker , ask your questions afterwards .───不要打斷那位講話(huà)的人,等一會(huì )再問(wèn)你的問(wèn)題。
69 、Could you interrupt your speech to pour more wine?───你能不能中斷一下演講,再斟上一些酒呢?
70 、No, you're not interrupting anything at all.─── 沒(méi)事 反正也沒(méi)打擾到什么
71 、A table containing interrupt vectors and indexed by interrupt type.───一個(gè)表格,包含由中斷類(lèi)型決定的中斷向量和索引。
72 、Don't let me interrupt you, just carry on.───別讓我打斷你,請繼續。
73 、A unique number associated with each interrupt.───和每一個(gè)中斷相關(guān)聯(lián)的唯一數字.
74 、He is taling ceaselessly, I even can't interrupt one word.───他不停地講,我連一句話(huà)都**不上。
75 、Most days, I'm happy to be both, but the world keeps interrupting, and I am sick of being interrupted.─── 大多時(shí)候 兩者都讓我開(kāi)心 但世界不斷干涉我 我受夠了 總是*涉
76 、Do not interrupt the ROM upgrade process.───不要中斷ROM的升級進(jìn)程。
77 、"But how did it end?" I interrupt.───“可這事兒是怎么拉倒的?”我打斷他又問(wèn)。
78 、Don't interrupt the other people's compliment to you.───不要打斷別人對你的稱(chēng)贊。
79 、I've not interrupted... I'm with the physio.─── 我沒(méi)打擾你... 理療師在給我*
80 、Interruptible load management is an important part of demand side management.───可中斷負荷管理是電力需求側管理的一項重要內容。
81 、A unique umber a ociated with each interrupt.───和每一個(gè)中斷相關(guān)聯(lián)的唯一數字。
82 、Don' t interrupt her : let her have her say.───別打斷她的話(huà), 讓她把意見(jiàn)說(shuō)出來(lái).
83 、Interruptible load management (ILM) is an important part of Demand Side Management (DSM) in power market.───可中斷負荷管理是電力市場(chǎng)環(huán)境下需求側管理的重要組成部分,與電力系統安全經(jīng)濟運行密切相關(guān)。
84 、But Olive! -Shush, Popeye! Don't interrupt the International!───但是奧利夫!-噓,大力水手!不要打斷“國際”!
85 、But it is often necessary to interrupt this sequence.───但是往往需要間斷此順序。
86 、Never interrupt when you are being flattered.───不要打斷別人對你的恭維。
87 、It was all irrelevant, but I didn't dare interrupt him in midflow.───他說(shuō)的事情全都不相關(guān),但我還是不敢中途打斷他。
88 、Please don't interrupt me while I'm on the phone.───在我打**的時(shí)候請不要**嘴。
89 、What do you have in mind when you interrupt them?───你當時(shí)打斷他們想說(shuō)什么?
90 、Don't interrupt him; he's been writing away all morning and likes to have a long period free of other considerations.───別打攪他,他已不停地寫(xiě)了一上午了。他喜歡有個(gè)較長(cháng)的時(shí)間不受其它事情的干擾。
spinlock和Semaphore信號量的區別?
Mutex是一把鑰匙,一個(gè)人拿了就可進(jìn)入一個(gè)房間,出來(lái)的時(shí)候把鑰匙交給隊列的第一個(gè)。一般的用法是用于串行化對critical section代碼的訪(fǎng)問(wèn),保證這段代碼不會(huì )被并行的運行。
Semaphore是一件可以容納N人的房間,如果人不滿(mǎn)就可以進(jìn)去,如果人滿(mǎn)了,就要等待有人出來(lái)。對于N=1的情況,稱(chēng)為binary semaphore。一般的用法是,用于限制對于某一資源的同時(shí)訪(fǎng)問(wèn)。
Binary semaphore與Mutex的差異:
在有的系統中Binary semaphore與Mutex是沒(méi)有差異的。在有的系統上,主要的差異是mutex一定要由獲得鎖的進(jìn)程來(lái)釋放。而semaphore可以由其它進(jìn)程釋放(這時(shí)的semaphore實(shí)際就是個(gè)原子的變量,大家可以加或減),因此semaphore可以用于進(jìn)程間同步。Semaphore的同步功能是所有系統都支持的,而Mutex能否由其他進(jìn)程釋放則未定,因此建議mutex只用于保護critical section。而semaphore則用于保護某變量,或者同步。
另一個(gè)概念是spin lock,這是一個(gè)內核態(tài)概念。spin lock與semaphore的主要區別是spin lock是busy waiting,而semaphore是sleep。對于可以sleep的進(jìn)程來(lái)說(shuō),busy waiting當然沒(méi)有意義。對于單CPU的系統,busy waiting當然更沒(méi)意義(沒(méi)有CPU可以釋放鎖)。因此,只有多CPU的內核態(tài)非進(jìn)程空間,才會(huì )用到spin lock。Linux kernel的spin lock在非SMP的情況下,只是關(guān)irq,沒(méi)有別的操作,用于確保該段程序的運行不會(huì )被打斷。其實(shí)也就是類(lèi)似mutex的作用,串行化對critical section的訪(fǎng)問(wèn)。但是mutex不能保護中斷的打斷,也不能在中斷處理程序中被調用。而spin lock也一般沒(méi)有必要用于可以sleep的進(jìn)程空間。
---------------------------------------------------------------------------------------------
內核同步措施
為了避免并發(fā),防止競爭。內核提供了一組同步方法來(lái)提供對共享數據的保護。 我們的重點(diǎn)不是介紹這些方法的詳細用法,而是強調為什么使用這些方法和它們之間的差別。
Linux 使用的同步機制可以說(shuō)從2.0到2.6以來(lái)不斷發(fā)展完善。從最初的原子操作,到后來(lái)的信號量,從大內核鎖到今天的自旋鎖。這些同步機制的發(fā)展伴隨 Linux從單處理器到對稱(chēng)多處理器的過(guò)度;伴隨著(zhù)從非搶占內核到搶占內核的過(guò)度。鎖機制越來(lái)越有效,也越來(lái)越復雜。
目前來(lái)說(shuō)內核中原子操作多用來(lái)做計數使用,其它情況最常用的是兩種鎖以及它們的變種:一個(gè)是自旋鎖,另一個(gè)是信號量。我們下面就來(lái)著(zhù)重介紹一下這兩種鎖機制。
自旋鎖
自旋鎖是專(zhuān)為防止多處理器并發(fā)而引入的一種鎖,它在內核中大量應用于中斷處理等部分(對于單處理器來(lái)說(shuō),防止中斷處理中的并發(fā)可簡(jiǎn)單采用關(guān)閉中斷的方式,不需要自旋鎖)。
自旋鎖最多只能被一個(gè)內核任務(wù)持有,如果一個(gè)內核任務(wù)試圖請求一個(gè)已被爭用(已經(jīng)被持有)的自旋鎖,那么這個(gè)任務(wù)就會(huì )一直進(jìn)行忙循環(huán)——旋轉——等待鎖重新可用。要是鎖未被爭用,請求它的內核任務(wù)便能立刻得到它并且繼續進(jìn)行。自旋鎖可以在任何時(shí)刻防止多于一個(gè)的內核任務(wù)同時(shí)進(jìn)入臨界區,因此這種鎖可有效地避免多處理器上并發(fā)運行的內核任務(wù)競爭共享資源。
事實(shí)上,自旋鎖的初衷就是:在短期間內進(jìn)行輕量級的鎖定。一個(gè)被爭用的自旋鎖使得請求它的線(xiàn)程在等待鎖重新可用的期間進(jìn)行自旋(特別浪費處理器時(shí)間),所以自旋鎖不應該被持有時(shí)間過(guò)長(cháng)。如果需要長(cháng)時(shí)間鎖定的話(huà), 最好使用信號量。
自旋鎖的基本形式如下:
spin_lock(&mr_lock);
//臨界區
spin_unlock(&mr_lock);
因為自旋鎖在同一時(shí)刻只能被最多一個(gè)內核任務(wù)持有,所以一個(gè)時(shí)刻只有一個(gè)線(xiàn)程允許存在于臨界區中。這點(diǎn)很好地滿(mǎn)足了對稱(chēng)多處理機器需要的鎖定服務(wù)。在單處理器上,自旋鎖僅僅當作一個(gè)設置內核搶占的開(kāi)關(guān)。如果內核搶占也不存在,那么自旋鎖會(huì )在編譯時(shí)被完全剔除出內核。
簡(jiǎn)單的說(shuō),自旋鎖在內核中主要用來(lái)防止多處理器中并發(fā)訪(fǎng)問(wèn)臨界區,防止內核搶占造成的競爭。另外自旋鎖不允許任務(wù)睡眠(持有自旋鎖的任務(wù)睡眠會(huì )造成自死鎖——因為睡眠有可能造成持有鎖的內核任務(wù)被重新調度,而再次申請自己已持有的鎖),它能夠在中斷上下文中使用。
死鎖:假設有一個(gè)或多個(gè)內核任務(wù)和一個(gè)或多個(gè)資源,每個(gè)內核都在等待其中的一個(gè)資源,但所有的資源都已經(jīng)被占用了。這便會(huì )發(fā)生所有內核任務(wù)都在相互等待,但它們永遠不會(huì )釋放已經(jīng)占有的資源,于是任何內核任務(wù)都無(wú)法獲得所需要的資源,無(wú)法繼續運行,這便意味著(zhù)死鎖發(fā)生了。自死瑣是說(shuō)自己占有了某個(gè)資源,然后自己又申請自己已占有的資源,顯然不可能再獲得該資源,因此就自縛手腳了。
信號量
Linux中的信號量是一種睡眠鎖。如果有一個(gè)任務(wù)試圖獲得一個(gè)已被持有的信號量時(shí),信號量會(huì )將其推入等待隊列,然后讓其睡眠。這時(shí)處理器獲得自由去執行其它代碼。當持有信號量的進(jìn)程將信號量釋放后,在等待隊列中的一個(gè)任務(wù)將被喚醒,從而便可以獲得這個(gè)信號量。
信號量的睡眠特性,使得信號量適用于鎖會(huì )被長(cháng)時(shí)間持有的情況;只能在進(jìn)程上下文中使用,因為中斷上下文中是不能被調度的;另外當代碼持有信號量時(shí),不可以再持有自旋鎖。
信號量基本使用形式為:
static DECLARE_MUTEX(mr_sem);//聲明互斥信號量
if(down_interruptible(&mr_sem))
//可被中斷的睡眠,當信號來(lái)到,睡眠的任務(wù)被喚醒
//臨界區
up(&mr_sem);
信號量和自旋鎖區別
雖然聽(tīng)起來(lái)兩者之間的使用條件復雜,其實(shí)在實(shí)際使用中信號量和自旋鎖并不易混淆。注意以下原則:
如果代碼需要睡眠——這往往是發(fā)生在和用戶(hù)空間同步時(shí)——使用信號量是唯一的選擇。由于不受睡眠的限制,使用信號量通常來(lái)說(shuō)更加簡(jiǎn)單一些。如果需要在自旋鎖和信號量中作選擇,應該取決于鎖被持有的時(shí)間長(cháng)短。理想情況是所有的鎖都應該盡可能短的被持有,但是如果鎖的持有時(shí)間較長(cháng)的話(huà),使用信號量是更好的選擇。另外,信號量不同于自旋鎖,它不會(huì )關(guān)閉內核搶占,所以持有信號量的代碼可以被搶占。這意味者信號量不會(huì )對影響調度反應時(shí)間帶來(lái)負面影響。
自旋鎖對信號量
需求 建議的加鎖方法
低開(kāi)銷(xiāo)加鎖 優(yōu)先使用自旋鎖
短期鎖定 優(yōu)先使用自旋鎖
長(cháng)期加鎖 優(yōu)先使用信號量
中斷上下文中加鎖 使用自旋鎖
持有鎖是需要睡眠、調度 使用信號量
Binder 之 oneway 機制
Binder 是 Android 中的 IPC(進(jìn)程間通信)的最要一環(huán),它的作用就是:
像一些系統服務(wù)調用應用進(jìn)程的時(shí)候就會(huì )使用 oneway,比如 AMS 調用應用進(jìn)程啟動(dòng) Activity,這樣就算應用進(jìn)程中做了耗時(shí)的任務(wù),也不會(huì )阻塞系統服務(wù)的運行。
本篇不展開(kāi)它是如何通信的,只聊聊它的機制,分兩種:
首先是非 oneway 的情況:
這里的掛起相當于 Thread 的 sleep,是真正的"休眠",底層調用的是 waitEventInterruptible(), Linux 系統函數。
oneway 的情況,客戶(hù)端就不需要掛起線(xiàn)程等待:
寫(xiě)在最后,涉及到的 binder 命令也有規律:
版權聲明: 本站僅提供信息存儲空間服務(wù),旨在傳遞更多信息,不擁有所有權,不承擔相關(guān)法律責任,不代表本網(wǎng)贊同其觀(guān)點(diǎn)和對其真實(shí)性負責。如因作品內容、版權和其它問(wèn)題需要同本網(wǎng)聯(lián)系的,請發(fā)送郵件至 舉報,一經(jīng)查實(shí),本站將立刻刪除。