PDA

View Full Version : Multi-threading crunch-bang



code_glitch
08-04-2011, 08:50 PM
Just started updating my platformer/2d engine to use some extra threads, Ie, one screen updates screen and keeps cleaning my video memory and other variables of the Engine and underlying data along with my cache system for searching through arrays faster :p (Commonly used ones anyway) and I cam across an issue:



SmashMan: ../../src/xcb_io.c:249: process_responses: Assertion `(((long) (dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed.
Aborted


Along with exit code 134, which to me, makes no sense at all. I'm considering using some proof of concept code I used when I first explored multi-threading that tracks EVERY resource and manages what accesses what and when but it can't do speed for sqwat... That is, if it evern runs; since it was only proof of concepts its rather sloppy and, erm, a pain to debug/use for anything where reliability matters... Any thoughts?

JSoftware
08-04-2011, 08:58 PM
Almost all graphics framework are single thread only, unless you signal the mainthread to do operations on the resources. As something rather new in DirectX 11, there are the multicore extensions where you can do everything from seperate threads.

Either way, more info is needed :)

code_glitch
08-04-2011, 09:06 PM
Sure, I was just wondering if anyone could make anything of the error I posted, since it speaks none to me or google. I haven't had much luck with gdb (new to this debugging business, started earlier today) yet either. My suspicion is that two threads are accessing the same variable which may be a problem...

Edit: I lie, gdb has spoken! Yah:



[Thread debugging using libthread_db enabled]
[New Thread 0x7fffed4ea700 (LWP 3240)]
[Thread 0x7fffed4ea700 (LWP 3240) exited]
[New Thread 0x7fffed4ea700 (LWP 3241)]
[New Thread 0x7ffff04c9700 (LWP 3242)]
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
after 141 requests (140 known processed) with 2 events remaining.
[Thread 0x7ffff04c9700 (LWP 3242) exited]
[Thread 0x7fffed4ea700 (LWP 3241) exited]

Program exited with code 01.
When I run backtrace I get the 'No Stack' line...

Edit: more headway has been made: It would seem a thread cannot launch the procedure to update window information, and at a guess I believe it has something to do with window contexts?? Don't understand it but its now a low-priority issue more with functionality which I can probably fixe some other way. So if anyone can make sense of the above thank you very much, if not its just implementation: 1 result, 1,000,000 ways ;)

sorry for the wasted thread.

User137
09-04-2011, 04:34 PM
Are the threads freeing themselves properly? Never seen log like that but doesn't it look like it runs out of stack space for new threads.