[Verse-dev] more discussions about pushing

Thorsten Jordan Thorsten_Jordan at gmx.de
Tue Oct 26 19:09:46 CEST 2004


Emil Brink schrieb:
> On Mon, 25 Oct 2004 16:14:17 +0200
> Thorsten Jordan <Thorsten_Jordan at gmx.de> wrote:
> 
> Further, the delay *before* verse_callback_update() in line 751 (the
> call to mysleep(20)) is ill-advised. What you want to do is give Verse
> the CPU quickly, so don't delay before calling verse_callback_update().
> 
> With this delay commented out on my laptop (1 GHz P-III), I can upload
> the ppctest2.3ds scene in roughly 3,5 seconds, and the output reads
> like this:
on my system under linux this wasn't so.
I modified the code so that it waits for a fixed time, calling 
verse_callback_update as often as possible:

		unsigned waitms = qs/10+100;
		unsigned endtime = get_ticks() + waitms;
		while (get_ticks() < endtime) {
			verse_callback_update(50000);
		}

if the time is long enough, viewer calls are lost. the formula above 
seems best (qs = number of pending calls in queue).

with that the ppctest2.3ds takes 2.5secs, the bunny 17secs.
However sometimes the pusher crashes, here is the trace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1088962528 (LWP 3866)]
0x080775aa in callback_send_packet_ack ()
(gdb) bt
#0  0x080775aa in callback_send_packet_ack ()
#1  0x08071c87 in v_unpack_packet_ack ()
#2  0x08075835 in v_fs_unpack ()
#3  0x08074cfc in v_con_callback_update ()
#4  0x08074fd5 in verse_callback_update ()
#5  0x08059649 in wait_for_empty_queue () at push_model.cpp:751
#6  0x0805a69e in main (argc=2, argv=0xbffff974) at push_model.cpp:935

maybe this helps. Attached is the new pusher code (seems pretty good 
now). It also tells you how long it took to push the whole model.

I hope it compiles under Win32, i haven't tested that yet. Is there a 
GetTickCount() function? WinCE has it...

-- 
Greetings, Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: push_model.cpp
Type: text/x-c++src
Size: 33263 bytes
Desc: not available
Url : http://projects.blender.org/mailman/private/verse-dev/attachments/20041026/3ec04032/push_model-0001.cpp


More information about the Verse-dev mailing list