0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Reentrant とRecursive, OESK(64)

Last updated at Posted at 2024-04-28

C言語で書いている人で、ReEntrantとRecurciveを知らないことがあるらしい。

学んだソースコード、学んだ教科書によって生じるらしい。

<この項は書きかけです。順次追記します。>
This article is not completed. I will add some words in order.

C standard

ISO/IEC 9899 WD
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf

Recursive function call

6.5.3.3 Function calls
Recursive function calls shall be permitted, both directly and indirectly through any chain of other functions.

OSEK

11.2 Error handling
Error hook routine
The error hook routine (ErrorHook) is called if a system service returns a StatusType value not equal to E_OK. The hook routine ErrorHook is not called if a system service is called from the ErrorHook itself (i.e., a recursive call of error hook never occurs).
15.2.9 ErrorHook is never called recursively.
Recursive calling of ErrorHook possibly leads to unbounded recursion and was considered too dangerous.

Reentrant

C言語規格では、ライブラリの説明で記述がある。

再入可能な関数は、引数で渡した値を計算して返す処理で、内部変数を利用していなければ大丈夫。

  1. Library 7.1 Introduction, CN3054:2022 (13) p193.c
    https://qiita.com/kaizen_nagoya/items/7c55e9ce69e8518c916b

The functions in the standard library are not guaranteed to be reentrant and may modify objects with static or thread storage duration. 238)
Unless explicitly stated otherwise in the detailed descriptions that follow, library functions shall prevent data races as follows: A library function shall not directly or indirectly access objects accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function’s arguments. A library function shall not directly or indirectly modify objects accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function’s non-const arguments. 239) Implementations may share their own internal objects between threads if the objects are not visible to users and are protected against data races.

The functions in the standard library are not guaranteed to be reentrant and may modify objects with static or thread storage duration.223)
Unless explicitly stated otherwise in the detailed descriptions that follow, library functions shall prevent data races as follows: A library function shall not directly or indirectly access objects accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function’s arguments. A library function shall not directly or indirectly modify objects accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function’s non-const arguments.224) Implementations may share their own internal objects between threads if the objects are not visible to users and are protected against data races.
Unless otherwise specified, library functions shall perform all operations solely within the current thread if those operations have effects that are visible to users.225)

参考資料(Reference)

WSL上にnxtOSEKの開発環境を構築する方法
https://qiita.com/TsuneoNakanishi/items/76999b2e6b4e9cd30117

Raspberry Pi 3 Model B+ 向けにリアルタイムOSを実装してみた話
https://qiita.com/tenkoh2/items/baa8e0b6c09669793b4f

[メモ] TrampolineRTOSでLチカ (OSEK/VDX & AUTOSAR APIにあわせたRTOS)
https://qiita.com/mt08/items/65f2ac9bbdae09a34470

MacでLego Mindstorms NXT環境構築 in 2018
https://qiita.com/vivid344/items/2f23f846cd3b135c5a74

ETロボコン開発環境構築 for Mac
https://qiita.com/tac0x2a/items/b1d82050c660935765ef

[メモ] ERIKA様でLチカ (Arduino)
https://qiita.com/mt08/items/adc90efbbfc938be7cc4

COFEを使って水-エタノールの分離シミュレーションを行う
https://qiita.com/kijuky/items/0979327cf7e7c091da02

自己参考(Self Reference)

OSEKはもう流行らないのでしょうか。AUTOSAR(64)OSEK(1) https://qiita.com/kaizen_nagoya/items/b87687254b11f30cc2ee
OSEKを図から理解 OSEK(2) https://qiita.com/kaizen_nagoya/items/f87a7ff5aeb63803a022
OSEK OS(AUTOSAR OS)をざっくり理解するには OSEK(3) https://qiita.com/kaizen_nagoya/items/c68c0b86b97d4a90e6e2
calloutとcallback, OSEK/VDX OS and AUTOSAR OSEK(4) https://qiita.com/kaizen_nagoya/items/b95b81354d07b9172a56
OSEK/VDX ISO and 2.23 OSEK(5) https://qiita.com/kaizen_nagoya/items/4d6bcec01e0132f9c41c
OSEK/VDX OSEK(6) https://qiita.com/kaizen_nagoya/items/a7720994f2178a15be81
ISO OSEK/VDX and ISO Linux OS 同梱ソースをC++またはRUSTで書く企画 OSEK(7) https://qiita.com/kaizen_nagoya/items/27899e936c90b415d700
OSEK 記事で views 100,000を目指して OSEK(8) https://qiita.com/kaizen_nagoya/items/ff45ee55566eeff5f62e
自動車用OSを網羅する OSEK(9) https://qiita.com/kaizen_nagoya/items/a61144daf500a3f2b4f4
Smallest Set Profile and Automotive Profile, OSEK(10) https://qiita.com/kaizen_nagoya/items/0c5484f6562cc259e7f0
Exclusive Area, OSEK(11) https://qiita.com/kaizen_nagoya/items/d87ff4e08378dbcf68a7
自動車のソフトウェア、例えばAUTOSAR の仕事を始めてする方に, OSEK(12) https://qiita.com/kaizen_nagoya/items/1832634788c23498e054
名古屋で自動車関係のソフトウェア設計する際にあるといいかもしれない知識, OSEK(13) https://qiita.com/kaizen_nagoya/items/9f01d55e4bd0bd931c96
single task os and data, OSEK(14) https://qiita.com/kaizen_nagoya/items/6acbd5d2cfd3ed8bca60
AUTOSARといえば O で始まる用語は? OSEK(15) https://qiita.com/kaizen_nagoya/items/06c969fe5c4b3e7319e0
Automotive Software Expert Examination Exercise, Examples or Extract. OSEK(16) https://qiita.com/kaizen_nagoya/items/1762e0612ef01e036efb
自動運転資料集(1) OSEK(17) https://qiita.com/kaizen_nagoya/items/42eb2129e281f25eaab8
TOPPERS of the YearとAUTOSAR, AUTOSAR(39), OSEK(18) https://qiita.com/kaizen_nagoya/items/f241bb4a819733110b7a
Autosar 2.0を読む, AUTOSAR(25), OSEK(19) https://qiita.com/kaizen_nagoya/items/b44a1047c2c517d522fe
IT関連技術でお世話になった方々, OSEK(20) https://qiita.com/kaizen_nagoya/items/8a5bf487594cd106e8b8
AUTOSARの4つの入力, OSEK(21) https://qiita.com/kaizen_nagoya/items/72cef6028b9697f7968e
AUTOSAR これだけ知っていればなんとかなる。OSEK(22) https://qiita.com/kaizen_nagoya/items/7a63e706bfb8f331cfe4
AUTOSAR based on ISO, OSEK(23) https://qiita.com/kaizen_nagoya/items/867a709cdf6f4dbdecc6
AUTOSARと国際規格。AUTOSAR(65), OSEK(24) https://qiita.com/kaizen_nagoya/items/4ddba03efb942969b125
AUTOSAR入門, AUTOSAR(16), OSEK(25) https://qiita.com/kaizen_nagoya/items/5e43b8ef0935c32ee11d
AUTOSAR 記事1000までの道, OSEK(26) https://qiita.com/kaizen_nagoya/items/785473512f5f7f85a6bf
Autosarの課題, OSEK(27) https://qiita.com/kaizen_nagoya/items/617d10b0e34143030600
AUTOSAR: The past 20 years and he next 10 years, OSEK(28) https://qiita.com/kaizen_nagoya/items/2dab0707c01059c152c4
Autosar文書を読む(準備), OSEK(29) https://qiita.com/kaizen_nagoya/items/5f547173544703d267aa
AUTOSARが手に取るように分かるようになる。AUTOSAR(29), OSEK(30) https://qiita.com/kaizen_nagoya/items/ae092ea6aef89cdc15df
posixとethernet, osekとTCP/IP, osek(31) https://qiita.com/kaizen_nagoya/items/73b79a4a56f433bd53c0
斉藤直希「組み込み向けリアルタイムOSの基礎知識を整理する」を整理する, OSEK(32) https://qiita.com/kaizen_nagoya/items/d305e83b37d0c57dceb3
TOPPERS活用アイデア・アプリケーション開発コンテスト受賞作品紹介 まとめ作成中, OSEK(33) https://qiita.com/kaizen_nagoya/items/72b882d96b2841f25faf
はじめてのAUTOSAR(classic platform) <エンジニア夏休み企画>【読書感想文】, OSEK(34) https://qiita.com/kaizen_nagoya/items/696ad320f76f284664d7
AUTOSARとSimulink: Adaptive Platform, Classic Platformとマルチコア・共通化, OSEK(35) https://qiita.com/kaizen_nagoya/items/d613b0b14bfd91989a13
AUTOSAR Abstract Platformへの道(詳細編), OSEK(36) https://qiita.com/kaizen_nagoya/items/cb217133884fa0a2c704
building block:AUTOSAR Abstruct Platform , OSEK(37), https://qiita.com/kaizen_nagoya/items/bf7c17624f648fb9f392
系建築家(system architect)になるには, OSEK(38) https://qiita.com/kaizen_nagoya/items/8c341e69233cb32f6275
自己紹介 OSEK(39) https://qiita.com/kaizen_nagoya/items/90aa368f296613ec93b5
AUTOSAR 「完全に理解した」, OSEK(40) https://qiita.com/kaizen_nagoya/items/51983798ad7902b33cb1
Architecture 「toaster model」を出発点として, OSEK(41) https://qiita.com/kaizen_nagoya/items/9ab8b4bea3ff4e94b192
AUTOSAR Q&A。 AUTOSAR(30), OSEK(42) https://qiita.com/kaizen_nagoya/items/ba6c02b772e9617dc138
「人生で影響を受けた本100冊」に28冊足す計画(18冊), OSEK(43) https://qiita.com/kaizen_nagoya/items/3ae6633725df77261df8
Bosch Automotive Handbook and so on. OSEK(44) https://qiita.com/kaizen_nagoya/items/8e330ce57880f04d71d9
動車 記事 100, OSEK(45) https://qiita.com/kaizen_nagoya/items/f7f0b9ab36569ad409c5
何故、今、国際規格なのか。OSEK(46) https://qiita.com/kaizen_nagoya/items/6970577e3e94e5b51ccc
名古屋のIoTは名古屋のOSで。仮説(186)OSEK(47) https://qiita.com/kaizen_nagoya/items/fa6694bbec50723ea90a
AUTOSAR一覧作っていて気が付いたこと順位(ranking) osek(48) https://qiita.com/kaizen_nagoya/items/2c800548690dd9fb9f53
AUTOSAR教材作成3年計画, AUTOSAR(19) OSEK(49) https://qiita.com/kaizen_nagoya/items/84d8f1ecbbe7af7803af
AUTOSARの利点と方向性, OSEK(50) https://qiita.com/kaizen_nagoya/items/681902476520cccf3c3e
TOPPERS のAUTOSARへの貢献(更新中), AUTOSAR(15), OSEK(51) https://qiita.com/kaizen_nagoya/items/d363cf06e2176207b391
TOPPERS の AUTOSAR への貢献 II (改定中), OSEK(52) https://qiita.com/kaizen_nagoya/items/4614c04cfff70a241f77
A big wrapping cloth with the miniature garden, OSEK53) https://qiita.com/kaizen_nagoya/items/96411f20632e7f3ff73a
AUTOSAR R23-11 資料整理の計画(年越し懇親会遠隔開催時間投票含む)OSEK(54) https://qiita.com/kaizen_nagoya/items/6b939e2373e0e6047ae8
自動車用(車載)ソフトウェアの基本設計提案を作る。OSEK(55) https://qiita.com/kaizen_nagoya/items/9c218e65d98084b24dfe
自動車用(車載)ソフトウェアの基本設計提案を作る(2), OSEK(56) https://qiita.com/kaizen_nagoya/items/38cb4710410a0d51e7a0
マルチコアの壁, OSEK(57) https://qiita.com/kaizen_nagoya/items/f38e47574905c80c0706
実時間処理, OESK(58) https://qiita.com/kaizen_nagoya/items/1e36077736d11960bb64
CPU マルチコア マルチOS, OSEK(59) https://qiita.com/kaizen_nagoya/items/6bdb6116f0aa50c5372a
AUTOSAR related Standard, OSEK(60)
https://qiita.com/kaizen_nagoya/items/13b163f8515615ecc648
「あなたがAUTOSARのEditorだったらどの文書をどう書き換えたいか」選手権(0), OSEK(61)
https://qiita.com/kaizen_nagoya/items/0055bb88f43f98a61739
Call back, OSEK(62)
https://qiita.com/kaizen_nagoya/items/8c76f5e05cbd9125f86d
C言語教育はCコンパイラの写経で, OSEK(63)
https://qiita.com/kaizen_nagoya/items/088a9906797559cd8b8a
Reentrant とRecursive, OESK(64) 
https://qiita.com/kaizen_nagoya/items/cdc028f73fe2dea3090f
AUTOSARの基礎の仮説, OSEK(65)
https://qiita.com/kaizen_nagoya/items/ceaf360e69f81c332677
Linuxを学ばずに使う, OSK(66) 
https://qiita.com/kaizen_nagoya/items/b9859782bab0cf6c78a4
AUTOSAR わかりにくいこと12, AUTOSAR(27), OSEK(67)
https://qiita.com/kaizen_nagoya/items/68b0da5bee1421200a11
お盆には「箱庭」記事を書きましょう「もくもく会」の題材になる(1), OSEK(68)
https://qiita.com/kaizen_nagoya/items/a22bf2b1dab0ad3258d4
逆も真:社会人が最初に確かめるとよいこと。OSEK(69)
https://qiita.com/kaizen_nagoya/items/39afe4a728a31b903ddc
プログラマが安全工学シンポジウムで発表する動機、題材、技法。安全(22)OSEK(70)
https://qiita.com/kaizen_nagoya/items/b7adf3001eb325166e52
プログラマにも読んでほしい「QC検定にも役立つ!QCべからず集」OSEK(81) 
https://qiita.com/kaizen_nagoya/items/d8ada7b7fceafe2e5f0e
AUTOSAR文書の読み方(文書番号と発行年), AUTOSAR(23), OSEK(72)
https://qiita.com/kaizen_nagoya/items/daa3f7de7e86b89bcc33
計算機系事故記録(computer system trouble record), OSEK(73)
https://qiita.com/kaizen_nagoya/items/910847f01379903e40c8
basic: プログラムジェネレータジェネレータ。構造屋(architect)としての成功事例3失敗事例6, OESK(74)
https://qiita.com/kaizen_nagoya/items/117c7a1b6dad97470ae9
AUTOSAR記事一覧, OSEK(75)
https://qiita.com/kaizen_nagoya/items/89c07961b59a8754c869
AUTOSAR 文書番号, OSEK(76)
https://qiita.com/kaizen_nagoya/items/8b894228a0b76c2265c7
参考文献の参考文献は参考文献だ。清水吉男「「派生開発」を成功させるプロセス改善の技術と極意」を超えて, OSEK(77)
https://qiita.com/kaizen_nagoya/items/562a0cf784cf92bc0ebb
ボッシュ自動車handbook(英語)11版(0-1) 課題と記事一覧new, OSEK(78)
https://qiita.com/kaizen_nagoya/items/a9d2887bf2a7598dc8e5
プログラマの「プログラムが書ける」思い込みは強みだ。3つの理由。仮説(168)統計と確率(17) , OSEK(79)
https://qiita.com/kaizen_nagoya/items/bc5dd86e414de402ec29
最新規格のコンパイル, OSEK(80)
https://qiita.com/kaizen_nagoya/items/4e23544a7ee8a8f19b68

<この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。>
This article is an individual impression based on the individual's experience. It has nothing to do with the organization or business to which I currently belong.

文書履歴(document history)

ver. 0.01 初稿  20240428

最後までおよみいただきありがとうございました。

いいね 💚、フォローをお願いします。

Thank you very much for reading to the last sentence.

Please press the like icon 💚 and follow me for your happy life.

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?