[問題] 作業系統

看板TransCSI作者 (KKMAN)時間15年前 (2010/08/27 14:14), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
A function is called reentrant if its computation results are correct even if invoked by two or more processes simultaneously. Check if the following function is reentrant. If it is not, modify it so that it is reentrant. You can assume that you have synchronization primitives provided by an operating system. static int iCount; void foo(int x, int *p) { int y; y = x * 7; ++p; *p = 5678; iCount *= 7890; printf(“\nNew count: %d”, x); } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.123.101.251
文章代碼(AID): #1CTrVIL2 (TransCSI)
文章代碼(AID): #1CTrVIL2 (TransCSI)