Font Size: a A A

Based On Vc + + 6.0 Mfc Multi-threaded Communications Technology

Posted on:2003-12-06Degree:MasterType:Thesis
Country:ChinaCandidate:X L LiFull Text:PDF
GTID:2208360092966209Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
In order to improve the code's efficiency both in executing time and storing space, downstage and backstage programming were widely used on Multi-task Windows programs. To complete a task property, threads were used to realize both downstage and backstage duties commonly, so the communications among threads were demanded widely.Visual C++6.0 MFC provided an object oriented programming development environment for Windows 95/NT, it can be used to cope with most standard Windows programming by it's great many classes and support codes generated. By means of the development environment and dass code's high reliability, standard, we can get application code of high quality.The thesis's background was the project of Shannxi Province Natural Science Fund (In the year 2001)-the study of Software Reverse Engineering. The thesis presented a method of software redesign by guide of object oriented analysis and design, and specialized on an application aspect of Windows programming: The implementation of Multi-Thread communications based on MFC (Microsoft Foundation Class Library). The significance of the method was that it solved the problems of the demands of Software Reverse Engineering, the demands of Software Reuse, the reliability of software, the module of software, the time span and the cost of the development.By means of the analysis of the target system and software demands, the function model can be getting, with MFC, the module and standard code of high quality can be performed. In the process, it also generates related archives and quick model in classes about the target code system, but the architectures of the program hide behind the development system.Threads are divided into Worker Thread and User Interface Thread.The Worker Thread has no Message Rotation Queue and Window, so it can not receive messages. It is used to perform backstage task such as computation of CPU intensive, file I/O and so on. In the implementation of the Multi-Thread communications in the thesis, the Worker Thread performs a circulation of counting for a huge span of time, without the communication between main Thread and the Worker Thread, the CPU would be locked and the system would not respond. The User Interface Thread has both Message Rotation Queue and Window. So it can receive messages.The thesis detailed the outlook of the MFC and the relations among classes, and the realization of processes, threads in Visual C++6.0. the main body of the thesis specialized on 3 kinds of thread communication directly supported by MFC, that were by means of Global Variables, by means of User Defined Messages, by means of Event Object It also displayed the principle of communication, the method of implementation in the Multi-Thread communications. The main thread was a controls based on dialog, the worker thread was a circulation of counting lasting a long time. They use Event Object and User DefinedMessage to communicate. Without the communications between main thread and worker thread, CPU would be locked for a long time. By the communications, we can easily control the circulation of counting.A conclusion can be getting from the design and implementation of the Multi-Thread communication program that Multi-Thread communications are useful for those application aspects requiring more executing time efficiency, storing space efficiency, less development time span and higher reliability. And we can easily introduce the method into industry control and test for example, we can scheme the architecture of the program as main thread and worker thread, in main thread, we can do initialization and coordinating the worker threads. We arrange those tasks need more time span as backstage tasks which to be performed by worker threads. So the system can schedule them by priority. We can use the technology specialized in the thesis to make the threads to communicate so as to complete the task.
Keywords/Search Tags:MFC (Microsoft Foundation Class Library), Worker Thread, User Interface Thread
PDF Full Text Request
Related items