著者
芝 哲史 笹田 耕一 卜部 昌平 松本 行弘 稲葉 真理 平木 敬
雑誌
情報処理学会論文誌プログラミング(PRO) (ISSN:18827802)
巻号頁・発行日
vol.4, no.1, pp.90-108, 2011-03-16

本稿では,Ruby 処理系とほぼ完全な互換性を持つ AOT コンパイラの設計と実装について述べる.Ruby は数多くのライブラリを持ち,数多くの環境をサポートしているプログラミング言語の 1 つである.本研究では,Ruby 処理系との互換性,および可搬性に優れた手法を用いて,既存のすべての Ruby プログラムを,Ruby がサポートするすべての環境で高速化することを目標としている.我々は,この目標を達成するために,Ruby スクリプトをコンパイルしたバイトコード列を C 言語に変換し,Ruby 処理系の仮想マシン (RubyVM) 上で動作させる AOT コンパイラを開発した.開発した AOT コンパイラは,生成する C 言語ソースコードを RubyVM のメソッド呼び出し機構,例外処理機構などを利用して動作させることで,Ruby 処理系との互換性をほぼ完全に保ちながら,Ruby プログラムの実行を高速化する.本稿では開発した AOT コンパイラの設計と実装,開発によって得られた知見について詳しく解説する.そして,開発した AOT コンパイラの機能と性能を評価する.
著者
笹田 耕一 松本 行弘
雑誌
情報処理学会論文誌プログラミング(PRO) (ISSN:18827802)
巻号頁・発行日
vol.10, no.3, pp.16-16, 2017-06-16

マルチスレッドプログラミングは,共有するデータに対して,複数のスレッドから同時に読み込み,書き込みを行うとデータレースなどの問題を発生させるため,排他制御などの同期を適切に行わねばならず,難しい.この問題は,スレッドが変更可能なデータを簡単に共有できるため生じるので,そのような共有を制限する方法が必要である.プログラミング言語Rubyの次期メジャーバージョンであるRuby 3では,マルチスレッドプログラミングの持つ難しさを緩和するため,“Guild” というRuby向けの新しい並行実行モデルを検討している.インタプリタは1つ以上のGuildを持つ.変更可能なすべてのオブジェクトはある1つのGuildに所属し,Guild間では,変更可能なオブジェクトを共有しない.ただし,不変オブジェクトや,クラスやモジュールは共有する.Guildは1つ以上のスレッドを持ち,異なるGuildは並列に実行する.Guild間の通信はチャネルを通して行い,変更可能なオブジェクトをGuild間で通信するにはコピーと移籍という2つの方式を提供する.移籍は,所属するGuildを変更する操作であり,単なるコピーより軽量となる.性能などの観点から,変更可能なオブジェクトを共有しなければならない場合,特別なデータ構造を提供することができる.本提案は,既存のアイデアの「いいとこどり」を狙ったものである.本発表では,この並行実行モデルの目論見について議論する.
著者
松本 行弘 笹田 耕一
雑誌
情報処理
巻号頁・発行日
vol.56, no.12, pp.1156-1159, 2015-11-15

プログラミング言語Rubyは2013年に20周年を迎えた.2003年に本誌に寄稿した「Rubyの真実」を振り返り,「20年目のRubyの真実」としてまとめる.
著者
甘佐 京子 比嘉 勇人 長江 美代子 牧野 耕次 田中 知佳 松本 行弘
出版者
滋賀県立大学人間看護学部
雑誌
人間看護学研究 (ISSN:13492721)
巻号頁・発行日
no.7, pp.73-79, 2009-03

背景 精神疾患の多くは、思春期から青年期に発症するといわれている。精神障害に罹患した場合、早期受診・早期治療が重要であり、統合失調症においては精神病未治療期間 (duration of untreated psychosis) が予後を左右するとの報告もある。しかし、国内では、好発年齢にある時期の子ども達に向けての、啓蒙活動の実施やその成果についての報告は見られず、中学校の保健体育などでも精神障害についてはほとんど触れられていないのが現状である。 目的 中学生を対象にしたメンタルヘルス教育プログラムを構築するにあたり、中学生の精神障害に対する認識を明らかにすることを目的とする。方法 研究デザインは量的記述的研究であり、A市内の公立中学校(6校)の三年生714名を対象にアンケート調査を実施した。調査内容は、精神障害に対する知識の情報源となる媒体や疾患に対する具体的な認識および、「こころの病気」という語彙に対するイメージである。分析にはSPSS15.0J for windowsを使用し記述的統計を行った。なお、本研究は滋賀県立大学研究倫理審査委員会の承認を得た(07年11月第51号)。 結果 回答者は653名(男子316名、女子337名)。精神疾患について他者から聞いたことがあるかという問いでは、68%の生徒があると回答した。聞いた相手として中学校教諭28.9%と最も多く、次いで小学生教諭20.4%であった。具体的な疾患名として、うつ病は約90%の生徒が認知しているのに対して、強迫性障害や統合失調症については病名の認知が5%に満たなかった。これらの知識の情報源となった媒体は、おもにテレビ(68.9%)であり、教科書(5.4%)や授業(9.2%)は、10%に満たなかった。さらに、精神疾患のイメージは否定的な項目に偏る傾向が認められたが、「こわい」「嫌い」等の嫌悪を示すものより「辛い」「寂しい」といった悲哀を示すイメージの方が強かった。 結論 中学生の多くは、精神疾患に対して何らかの情報を持っているが、その多くはテレビ等のマスメディアによるものであり、正しい知識を得ているとは考えづらい。また、うつ病等メディアに取り上げられるものについては、少なからず認識しているが、思春期に発症しやすい統合失調症や強迫性障害などの認識は低く、当然自己との関連が深い疾患だととらえてはいないと推測できる。Background Most mental illnesses are thought to develop during puberty and young adulthood. Early diagnosis and early treatment are important for cases of mental disorders, and the duration of untreated psychosis can influence the prognosis of schizophrenia. In Japan, very few mental illness awareness programs are targeted at children of susceptible ages, and reports of these programs are also lacking. In addition, very little is taught about mental disorders in middle school health and physical education curr icula. Objective In order to create a mental health education curriculum for middle school students, we aimed to understand the awareness of mental disorders in these students. Methodology We employed a quantitative and descriptive study design, and surveyed 714 ninth graders from 6 public schools in city A by questionnaire. We surveyed their knowledge of specific conditions, their sources for information regarding mental disorders, and their image of the phrase "mental illness ." Descriptive statistical analysis was performed using SPSS15.0J for Windows. Our study was approved by the University of Shiga Prefecture Research Ethics Review Committee (November, 2007, No.51). Results Of the 653 respondents, 316 were male and 337 were female. Sixty-eight percent of the students had heard of mental illnesses , most often from middle school teachers (28.9%) followed by elementary school teachers (20.4%). In contrast to the 90% who knew depression as the name of a specific disorder, less than 5% knew the names of disorders such as obsessivecompulsive disorder and schizophrenia. Television was the cited source of this information for 68.9%, while less than 10% identified text books (5.4%) and classroom education (9.2%) as the source. Although the image of mental illness was usually negative, the respondents tended to characterize mental illness with terms expressing sorrow, such as "struggle" and "lonely" rather than those expressing aversion, such as "scary" and "dislike." Conclusion The majority of middle school students have some knowledge of mental illness, but most of it is obtained from mass media, such as television. As such, it is unlikely that their obtained knowledge is accurate. Although they are relatively aware of conditions such as depression which are dealt with by the media, they are much less aware of conditions such as schizophrenia and obsessive-compulsive disorder, which easily develop during puberty. We surmise, therefore, that the students do not consider these conditions to be highly relevant to them.
著者
中村 成洋 松本 行弘
雑誌
情報処理学会論文誌プログラミング(PRO) (ISSN:18827802)
巻号頁・発行日
vol.2, no.2, pp.176-176, 2009-03-23

Apache HTTP サーバのもとで提供される Web サービスのような,ひんぱんにサブプロセスが生成される環境下では,現在 Ruby が採用しているマークビットをオブジェクトヘッダ内に持つマークスイープ方式のゴミ集め実装は,copy-on-write によるメモリページ共有を疎外し,必要以上にメモリを消費する.本研究では,マークをオブジェクトヘッダ内から独立したビットマップに移すことによるメモリ消費量実行性能の変化を示す.効率的なビットマップマーキングのためにはオブジェクトポインタからビットマップの特定の位置の計算が必要である.一般的にはビットマップ位置をたとえば 1M バイト単位でアラインしておきアドレスをマスクすることでビットマップ位置を求めることが行われている.しかし,Ruby のように種々のプラットフォームで動作する言語処理系では,利用できるメモリ割当て API はmalloc() しかないため,効率良くアラインされたメモリを確保する方法は知られていない.本研究では Ruby のオブジェクト配置方式を利用し,移植性を維持したまま,オブジェクトポインタから定数時間でビットマップ位置を計算する手法を提案する.また,二分検索を用いたビットマップマーキングと比較したマーキング性能の改善も示す.Since mark-and-sweep garbage collection scheme, which Ruby interpreter uses modifies every living object, it suffers performance problems due not to utilize copy-on-write memory page sharing among processes, under the circumstances like web-services running under Apache HTTP servers. In this paper, we proposes adding bitmap marking for Ruby's garbage collection. We show much memory usage and performance change by bitmap marking. For efficient bitmap marking, it is needed to calculate bitmap position from an object pointer. Prior art uses aligns heap memories and pointer masking to retrieve bitmap position from object pointer. But Ruby interpreter runs on various platforms, and we do not have portable memory allocation API to obtain aligned memory region without wasting region. In this paper, we propose portable scheme to map from object pointers to corresponding bitmap table in constant time. We also show how much proposed bitmap marking improves performance, comparing bitmap marking method using binary search to obtain bitmap position from object pointers.