《軟件學(xué)報(bào)》排版樣例(中文論文)2005版_第1頁(yè)
《軟件學(xué)報(bào)》排版樣例(中文論文)2005版_第2頁(yè)
《軟件學(xué)報(bào)》排版樣例(中文論文)2005版_第3頁(yè)
《軟件學(xué)報(bào)》排版樣例(中文論文)2005版_第4頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、并發(fā)面向?qū)ο笾械睦^承反?,F(xiàn)象王生原1+, 楊良懷2, 袁崇義3, 楊 萍41(清華大學(xué)計(jì)算機(jī)科學(xué)與技術(shù)系, 北京100084) 2(新加坡國(guó)立大學(xué)計(jì)算學(xué)院計(jì)算機(jī)科學(xué)系,新加坡 )3(北京大學(xué)計(jì)算機(jī)科學(xué)技術(shù)系,北京100871) 4(蘭州大學(xué)信息科學(xué)與工程學(xué)院, 甘肅蘭州730000) inheritance anomaly in concurrent object orientation*wang sheng-y uan1+, yang liang-huai2, yuan chong-y i3, yang ping41(department of compu ter science and t

2、echnology, tsinghua university, beijing 100084, china) 2(department of compu ter science, school of computing, national university of singapore, singapore)3(department of compu ter science and technology, beijing university, beijing 100871, china) 4(school of information science and technology, lanz

3、hou university, lanzhou 730000, china)+ corresponding author: phn: +86-10-62645407, fax: +86-10-62645000, e-mail: , http:/received 2002-10-08; accepted 2003-01-05 abstract : the combination of concurrency and object orientation is definitely natural except for inheritance. one of the interferences b

4、etween inheritance and concurrency is inheritance anomaly. although havin g been researched ext ensively, inheritance anomalies are still only vaguely defined and often misunderstood, and no much formal work has been done. a new viewpoint is set forth for understanding inheritance anomalies, in whic

5、h each subtyping relation has its specific incremental inheritance. related concepts and definitions are formalized through the language of category. some issues are well adapted to distinguish and explain different standpoints about inheritance anomalies, and can serve as guidelines in the modeling

6、 of inheritance. key words: concurrency; object orientation; inheritance anomaly; incremental inheritance; category theory support ed by the national natural science foundation of china under grant no.60373000 ( 國(guó)家自然科學(xué)基金); the nationalhigh-tech research and development plan of china under grant nos.

7、863-317-01-04-99, 2001aa115126 (國(guó)家高技術(shù)研究發(fā)展計(jì)劃(863); the national grand fundamental research 973 program of china under grant no.g1999032706 ( 國(guó)家重點(diǎn)基礎(chǔ)研究發(fā)展規(guī)劃(973); the key science-technology project of the national ,ninth five-year-pl an? of china under grant no.98 -780-01-07-03 ( 國(guó)家“ 九五” 重點(diǎn)科技攻關(guān)項(xiàng)目); the

8、defense pre-research project of the ,ni nth five -year-plan? of china (國(guó)家“ 九五” 國(guó)防預(yù)研基金); the national research foundation for the doctoral program of higher education of china ( 國(guó)家教育部博士點(diǎn)基金); the ministry & commission-level research foundation of chi na (部委級(jí)基金 ); the nat ural sci ence foundation o

9、f gansu province of china under grantno.zs991-a25-014-g (甘肅省自然科學(xué)基金) 作者簡(jiǎn)介 : 王生原 (1964), 男,山西應(yīng)縣人 ,博士 ,副教授 ,主要研究領(lǐng)域?yàn)榉植紝?duì)象計(jì)算,petri 網(wǎng)應(yīng)用 ,嵌入式軟件環(huán)境;楊良懷(1967),男,博士 ,講師 ,主要研究領(lǐng)域?yàn)閿?shù)據(jù)庫(kù)系統(tǒng)實(shí)現(xiàn)技術(shù),數(shù)據(jù)倉(cāng)庫(kù) ,半結(jié)構(gòu)化數(shù)據(jù),web 數(shù)據(jù)集成 ,數(shù)據(jù)挖掘 ;袁崇義 (1941),男,教授 ,博士生導(dǎo)師 ,主要研究領(lǐng)域?yàn)椴⑿杏?jì)算,petri 網(wǎng)理論及應(yīng)用;楊萍 (1964),女,副教授 ,主要研究領(lǐng)域?yàn)槿斯ぶ悄? 王生原等:并發(fā)面向?qū)ο笾械睦^承反常

10、現(xiàn)象961 摘要: 如果不考慮繼承性,并發(fā)性與對(duì)象技術(shù)的結(jié)合是很自然的.繼承反常 (又稱繼承異常)現(xiàn)象是繼承性和并發(fā)性不相容的主要原因之一.現(xiàn)階段人們對(duì)繼承反?,F(xiàn)象的認(rèn)識(shí)有許多模糊之處,出發(fā)點(diǎn)不盡相同,形式化的工作也很少 .對(duì)不同的subtyping 關(guān)系考慮其特有的漸增式繼承方法有利于把握繼承反常現(xiàn)象的實(shí)質(zhì),也豐富了“ 在并發(fā)面向?qū)ο笳Z(yǔ)言中應(yīng)將inheritance 層次和subtyping 層次區(qū)別對(duì)待” 這一認(rèn)識(shí)的內(nèi)涵.在闡述基本觀點(diǎn)之后,采用范疇論的術(shù)語(yǔ)對(duì)相關(guān)的概念和定義做了形式化工作.一些觀點(diǎn)和結(jié)論適用于區(qū)分和解釋相關(guān)工作的出發(fā)點(diǎn)和貢獻(xiàn) ,并對(duì)并發(fā)面向?qū)ο蠹夹g(shù)中繼承性的建模問題有所啟

11、示. 關(guān)鍵詞 : 并發(fā)性 ;面向?qū)ο?;繼承反常 ;漸增式繼承 ;范疇論中圖法分類號(hào): tp301文獻(xiàn)標(biāo)識(shí)碼: a inheritance( 繼承 )是類 (class)之間的一種層次關(guān)系.在一般的面向?qū)ο笳Z(yǔ)言中,類層次自動(dòng)對(duì)應(yīng)了一種類型(type) 層次1,這樣 ,superclass 和 subclass 之間的關(guān)系自然是一種supertype 和 subtype 之間的關(guān)系 . 1 認(rèn)識(shí)繼承反常現(xiàn)象如圖 1 所示 ,類 buffer 實(shí)現(xiàn)了一個(gè)有界緩沖區(qū)類型,可以并發(fā)地接受消息put 和 get.同步機(jī)制采用了“method guards ”方式 ,即為每一個(gè)method 附加一個(gè)gua

12、rd 謂詞2.構(gòu)造 buffer 的另一個(gè)子類lockablebuffer也會(huì)引發(fā)同樣的問題 .這種 “ 為獲得有效繼承而必須對(duì)父類代碼進(jìn)行實(shí)質(zhì)性修改的現(xiàn)象” 就是所謂的繼承反常(inheritance anomaly)35. 2 理解繼承反?,F(xiàn)象2.1 區(qū)別 inheritance 和subtyping綜合各種觀點(diǎn),要理解和解釋繼承反?,F(xiàn)象,首先必須正確區(qū)別inheritance 層次和 subtyping 層次 ,并深刻領(lǐng)會(huì)二者的聯(lián)系6, 7.對(duì)于這個(gè)問題,文獻(xiàn) 1,8 的觀點(diǎn)是比較權(quán)威的.在此基礎(chǔ)上 ,我們的理解是:inheritance是在代碼層次上作修改,而 subtyping 是在

13、語(yǔ)義層次上作修改.前者是代碼共享的一種重要途徑,但不能保證subclass 能夠繼承 superclass 的行為 ;后者要求subtype 保持 supertype 的某種外部可觀察行為(或語(yǔ)義行為 ),在規(guī)范一級(jí)共享,同代碼沒有關(guān)系.inheritance層次關(guān)系可以理解為“is_similar_to”(或“l(fā)ike ”)的關(guān)系 ,而將 “is_a ”關(guān)系更適合用在理解 subtyping 層次關(guān)系上 ,見表 19. table 1latency of macro-instructions 表 1宏指令的時(shí)延acronymmacro-inst ructions latency (ns) e

14、vent symbolvalue symbol nsi net_slice_init() 87 n( ,e) nst net_slice_stop() 154 nse net_slice_exit() 904 (1.4%) n( ,e) nso inter-overhead bet ween net_slice_start() and net_slice_stop() 150 on(o,e) nsa overhead of net_slic e_start() 303 n( ,e) 命題 1. 設(shè) rrl,rr,r 定義的 class 范疇為 cr,r定義的class 范疇為cr,則 cr是

15、cr的子范疇 ,并稱之為 cr的子 class 范疇 . 證明 :對(duì)任何 a,b ob cr=ob cr,homcr(a,b)homcr(a,b). 推論 1. 任何 rrl定義的 class 范疇 cr都是 cl的子 class 范疇 . interest patternsvector clustering pattern derivation feature extractiondocumentdatabase vector database documentclusters interesttopicsfig.1 mining interest patterns 圖 1 興趣模式的挖掘過

16、程962 2.2 漸增式繼承subtyping 要求 subtype 保持 supertype 的某種行為 (可看作是一種不變量,比如同步約束)10.subclass 在增加新的屬性或方法時(shí),為了避免破壞這種不變量,難免要對(duì)繼承的代碼進(jìn)行擴(kuò)展或修改.這種擴(kuò)展或修改很可能是重大的或?qū)嵸|(zhì)性的,結(jié)果使得代碼共享失去意義.這便是繼承反常的直觀含義. 假定非線性優(yōu)化問題: yxzzyxxzdd1min22(1) 的近似解為3030)()(),(ijniniijybxbbyxz,其中3030,iijjbbbb由邊界條件決定.確定其余幾個(gè)b zier 系數(shù)是一個(gè)非線性約束優(yōu)化問題.我們采用基于一維線性搜索的

17、整體收斂的newton 迭代方法來(lái)求解.其基本的迭代格式為.1niiipxx步長(zhǎng)i采用回溯線性搜索方法確定,下降方向np是 newton 方向 ,這種非線性優(yōu)化方法是一個(gè)比較成功的具有整體收斂性的方法,對(duì)于初值的選擇沒有苛刻的要求. 基于 tb-ccrd的新系統(tǒng)采用與linux 直接路由 式 虛 擬服 務(wù) 器 相 同 的 框 架結(jié) 構(gòu)11.如圖2 所示,dwss的各個(gè)后端服務(wù)器通過高速以太網(wǎng)相互連接 ,它們屏蔽arp協(xié)議 ,并擁有與前端機(jī)相同的ip(記為 vip)和 web 服務(wù)端口號(hào) (記為 vport), 在用戶看來(lái) ,這個(gè)系統(tǒng)就相當(dāng)于一個(gè)ip 地址為vip,服務(wù)端口號(hào)為 vport 的

18、web服務(wù)器 .在新系統(tǒng)中 ,前端機(jī)負(fù)責(zé)接收來(lái)自用戶的數(shù)據(jù)包,發(fā)放用于指示處理該數(shù)據(jù)包最適當(dāng)?shù)姆?wù)器id( 可以是后端機(jī)在系統(tǒng)內(nèi)部的標(biāo)識(shí)符 ,也可以是它的mac地址 )的標(biāo)記 ,并轉(zhuǎn)發(fā)數(shù)據(jù)包 ;后端機(jī)則負(fù)責(zé)處理由前端機(jī)轉(zhuǎn)發(fā)而來(lái)的用戶數(shù)據(jù)包并直接回應(yīng)用戶,具體包括建立/拆除與用戶的 tcp 連接、 tcp 連接轉(zhuǎn)交以及提供url 內(nèi)容等工作 . 2.2.1 定義繼承反?,F(xiàn)象本節(jié)是對(duì)上述觀點(diǎn)的形式化描述,可與第 2.2 節(jié)對(duì)照閱讀 .范疇論的觀點(diǎn)層次較高,易于抽象出問題的本質(zhì). 與程序 p 在 f 下運(yùn)行等價(jià)的錯(cuò)誤影響程序pf有2.2.2 解釋繼承反常現(xiàn)象例 1:在談到順序面向?qū)ο笳Z(yǔ)言時(shí),一般不涉

19、及繼承反常現(xiàn)象.這是因?yàn)?,這類語(yǔ)言l 都默認(rèn)一個(gè)特殊的subtyping 關(guān)系 p(由 rl定義的完整inheritance 層次關(guān)系被默認(rèn)為相應(yīng)于p 的漸增式繼承關(guān)系),它對(duì)應(yīng)的type范疇記為tl,滿足 :cl實(shí)現(xiàn) tl,實(shí)現(xiàn)函子為f:a(aob clfa type(a).l 無(wú) p-繼承反常 .因?yàn)轫樞蛎嫦驅(qū)ο笳Z(yǔ)言不提供定義subtyping 關(guān)系的機(jī)制 ,所以這種默認(rèn)的subtyping 關(guān)系是語(yǔ)言中惟一的subtyping 關(guān)系 ,這些語(yǔ)言l 無(wú)繼承反常 . 3 結(jié)束語(yǔ)本文形式地給出了“ 繼承反常現(xiàn)象” 的一種一般性定義.定義對(duì)每一種subtyping 關(guān)系都有其相對(duì)應(yīng)的“ 漸增式

20、繼承 ” ,使其更具有普適性.文中 “ 漸增式繼承 ” 是一個(gè)相對(duì)的概念,這有助于對(duì)人們“ 使繼承反常現(xiàn)象得到緩解”(2) initpf=initp, varpf=varf, unitpf=a1f;a2f;anf, wherepf=wherepfaultassumptionf. internetresponse requestbrowser front_end server back_end server back_end server back_end server . . . fig.2 the framework of the tb-ccrd based dwss 圖 2 基于標(biāo)記的緩存

21、協(xié)作dwss 系統(tǒng)框架王生原等:并發(fā)面向?qū)ο笾械睦^承反常現(xiàn)象963 的努力得以分類和評(píng)價(jià). 致謝在此 ,我們向?qū)Ρ疚牡墓ぷ鹘o予支持和建議的同行,尤其是北京大學(xué)計(jì)算機(jī)科學(xué)技術(shù)系袁崇義教授、屈婉玲教授領(lǐng)導(dǎo)的討論班上的同學(xué)和老師表示感謝. references: 1 clif ton c, leavens gt, chambers c, millstein t. multijava: modular open classes and symm etric multipl e dispatch for java. acmsigplan noti ces, 2000,35(10):130-145.2 w

22、egner p, zdonik sb. inheritance as an incremental modi fication mechanism or what like is and isn?t like. in: gjessing s, nygaar d k, eds. proc. of the ecoop?88. lncs 322, heidelberg: springer-verl ag, 1988. 55-77.3 waxman bm. routing of multi point connections. ieee journal on selected areas in com

23、muni cations, 1988,6(9): 1617-1622. 4 yonezawa a. abcl: an object-ori ented concurrent system. cambridge: mit press, 1990.5 matsuoka s, yonezawa a. analysis of inherit ance anomaly in obj ect-orient ed concurrent programming l anguages. in: agha g, wegner p, yonezawa a, eds. research di rections in

24、concurrent object-ori ented programming. cambridge: mit press, 1993. 107-150. 6 hemige v. obj ect-oriented design of the groupware layer for the ecosystem inform ation system ms. thesis. university of montana, 1995.7 rose a, perez m, clements p. modechart toolset user?s guide. techni cal report, nml/mrl/5540-94-7427, austin: university of texa

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論