Re: [Plib-users] Multithreading in FG
Brought to you by:
sjbaker
From: Stuart M. <stu...@bl...> - 2006-08-28 15:14:19
|
Hi, I can't see anything obviously wrong with that code, but here's the solution I used. I used the set of headers for threading from http://www.codeproject.com/threads/thread_class.asp These work on both linux and windows (and cygwin). I got them working with no knowledge of threading straight away and they provide a nice clean interface. They also have mutex and semaphore classes which are also very handy for threaded apps. The code is small, easy to see what's going on and well documented. Even if you don't use it it's probably worth looking at to see if it helps with your problem. Good luck, Stuart. -----Original Message----- From: pli...@li... [mailto:pli...@li...] On Behalf Of Hemalatha Sharma Sent: Monday, August 28, 2006 1:29 PM To: fli...@fl...; fli...@li...; fli...@fl... Cc: pli...@li...; pli...@li... Subject: [Plib-users] Multithreading in FG Hi, We are using Flightgear version 0.9.4, in which we are trying to implement multi-threading. In one thread, processing of next frame will be done and in the other, rendering of the previous frame. Here, fgMainLoop() is split into two threads, all the processing before calling fgRenderFrame() in one thread, i.e. subsystem updates, input/output updates, tile manager updates, etc., and fgRenderFrame() in the other thread. Is this the correct method of splitting processing and rendering of frame data? We are using the below to create a thread: hThread[1] = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)fgRenderFrame1,NULL,0,&dwID[ 1]); CloseHandle(hThread[1]); Using the above gives us stack dump error. Please give us a solution as to how to implement threading. Eagerly waiting for your reply. Regards, Hemalatha <http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/s ignature-home.htm/1507191490@Middle5?PARTNER=3> |