Sign-up....

蛮郁闷!老师给我们布置的编程题都是用E文,题目都难看不懂,哪能展拳脚啊!借大家的优势一用!高分相送!

蛮郁闷!老师给我们布置的编程题都是用E文,题目都难看不懂,哪能展拳脚啊!借大家的优势一用!帮我翻译一下了,看看是什么意思了。若能给些相关的例子那就更好了!先谢了!

Experiment 1

The usage of some Win32 APIs performing the system call function.

–Create a new process.

–Create another process that waits for the preceding process to exit and then exits itself.

–Be familiar with the usage of other Win32 APIs through reading relevant comments and examples in MSDN.

=============

STARTUPINFO si;

PROCESS_INFORMATION pi;

ZeroMemory( &si, sizeof(si) );

si.cb = sizeof(si);

ZeroMemory( &pi, sizeof(pi) ); // Start the child process.

if( !CreateProcess("D:\\Winamp\\Winamp.exe", // Module name.

NULL, // Command line.

NULL, // Process handle not inheritable.

NULL, // Thread handle not inheritable.

FALSE, // Set handle inheritance to FALSE.

0, // No creation flags.

NULL, // Use parent's environment block.

NULL, // Use parent's starting directory.

&si, // Pointer to STARTUPINFO structure.

&pi ) // Pointer to PROCESS_INFORMATION structure.

)

{

::MessageBox( NULL,"CreateProcess failed." ,"CreateProcess failed.",MB_OKCANCEL);

}

// Wait until child process exits.

WaitForSingleObject( pi.hProcess, INFINITE ); // Close process and thread handles.

CloseHandle( pi.hProcess );

CloseHandle( pi.hThread );

==========================================

Experiment 2

Solve the producer-consumer problem using semaphore.

–Create semaphore.

–Manipulate semaphore.

–Create threads.

–Coordinate the execution of multiple threads.

–Program a simulation implementing the producer-consumer problem.

CreateThread

CreateSemaphore

WaitForSingleObject

ReleaseSemaphore

ExitThread

SetThreadPriority

Several Candidate Win32 APIs

=========================================

Experiment 3

Program a simulation of the banker’s algorithm. Your program should cycle through each of the bank clients asking for a request and evaluating whether it is safe or unsafe. Output a log of requests and decisions to a file.

–Each client can be modeled by an array of resource requests.

–At each scheduling point, a request chosen randomly is evaluated ( The lottery heduling algorithm seems to be a good candidate).

–Record a log into an array and output it finally.

=========================================

Experiment 4

Write a program that simulates a paging system. At the start of the program, the user should be asked to choose a page replacement algorithm, e.g. FIFO, LRU.

–Input the numbers of referenced pages.

–Generate a list similar to Fig.4-25.

–Compare the performance of different page replacement algorithms, e.g. page fault rate.

========================================

Experiment 5

The usage of Win32 APIs relevant to file operations.

–Create a file.

–Read and write a file.

–Copy and delete a file.

–Directory operations.

[2999 byte] By [msdn] at [2007-8-14 18:01:24]
# 1 Re: 蛮郁闷!老师给我们布置的编程题都是用E文,题目都难看不懂,哪能展拳脚啊!借大家的优势一用!高分相送!
LRU: 最近最少使用算法,forgot.
shanzi_21 at 2004-11-16 19:19:00 >
# 2 Re: 蛮郁闷!老师给我们布置的编程题都是用E文,题目都难看不懂,哪能展拳脚啊!借大家的优势一用!高分相送!
=============== =========== 實驗(試驗) 5 贏得32 埃皮斯 有關的用法把操作歸檔。

–創造(引起)文件。

–閱讀和寫文件。

–拷貝和刪除文件。

– 號碼簿 operations .

umit12020 at 2004-11-17 09:27:00 >
# 3 Re: 蛮郁闷!老师给我们布置的编程题都是用E文,题目都难看不懂,哪能展拳脚啊!借大家的优势一用!高分相送!
谷雨兄,强啊!
shipingjing at 2004-11-17 10:36:00 >

扩充话题

All Classified