Re: [Plib-users] Multithreading in FG
Brought to you by:
sjbaker
From: Hemalatha S. <hem...@re...> - 2006-08-30 04:55:51
|
=A0=0AHi,=0AThanks for your reply.=0AWe are trying to project three views(= center,left,right) on to three projector screens.Aircraft data(lat,lon,alt = etc) is sent to these three systems from one system through ethernet.=0A=0A= We need to synchronize all the three views.=0A=0AWe have tried one of the m= echanism to synchronize.......=0A=0ABefore swapping buffers, the left and r= ight systems send done signal to the center system.Once the center system r= ecieves done signal from both the systems, it sends release signal to both = the system saying that it can swap the buffers.=0ABy doing this there was s= ome improvement seen but with some delay.=0A=0A=0APlz help me to sort out t= his problem.=0A=0AWaiting for your reply.=0ARegards,=0AHemalatha=0A=0AOn Tu= e, 29 Aug 2006 steve wrote :=0A>I havn't given much thought to threading al= ternate frames - the=0A>reason being that the increase in latency is not wo= rth the savings=0A>in frame time. I design flight simulators for a living = - and the=0A>fight to keep latency down is at least as important as the fig= ht to=0A>keep frame rates up.=0A>=0A>Nothing in PLIB was ever designed for = threading - so expect a LOT=0A>of things to break!=0A>=0A>Sadly, you are on= your own on this one - this is not a path I'm=0A>interested in treading - = it's a steep and twisty path and it's=0A>leading in the wrong direction.=0A= >=0A>Good luck!=0A>=0A>Hemalatha Sharma wrote:=0A>> Hi,=0A>>We are using = Flightgear version 0.9.4, in which we are trying to implement multi-threadi= ng. 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 threa= ds, all the processing before calling fgRenderFrame() in one thread, i.e. s= ubsystem updates, input/output updates, tile manager updates, etc., and fg= RenderFrame() in the other thread.=0A>>=0A>>Is this the correct method of s= plitting processing and rendering of frame data?=0A>>=0A>>We are using the = below to create a thread:=0A>>hThread[1] =3D CreateThread(NULL,0,(LPTHREAD_= START_ROUTINE)fgRenderFrame1,NULL,0,&dwID[1]);=0A>> CloseHandle(hThre= ad[1]);=0A>>=0A>>Using the above gives us stack dump error.=0A>>=0A>>Please= give us a solution as to how to implement threading.=0A>>Eagerly waiting f= or your reply.=0A |