Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Threading Questions

Author
Message
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 6th Sep 2007 12:32
Hi I would like to know if DGK support multithread e.g position the camera on one thread and key events on another?

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 6th Sep 2007 15:02
I believe this was talked about and the answer is no. Could be wrong though.
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 6th Sep 2007 17:08
I'm doing something similar with DGDK.net, I'm not sure how thread safe it is, so I am using "Mutesxes" to try and avoid crashes. The only problem I can foresee is which thread handles the things like Syncing etc.

Jas

----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"
psx
17
Years of Service
User Offline
Joined: 16th Apr 2007
Location:
Posted: 9th Sep 2007 01:29
I think this is possible( multi-threading in DarkGDK )

if you have something like sub-engine, written on clean C++,
you can use multi-threading there inside.
It seems that we cannot use GDK funcs in separate threads.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 9th Sep 2007 02:19
Only TGC can answer the threading issue, and I think that there could be certain issues because of the Global structure for maintaining variable data etc. If a mutex is used to protect this structure from threading issues, I think that DGDK and DGDK.NET would be ok for threading. DirectX should probably follow this philosophy as well.

My point is... if you protect any call to the library from being interrupted via another call into the library from another thread, you'll probably be ok.

At the end of the day, what's thw worst that could happen?

Paul.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Sep 2007 02:41
Quote: "At the end of the day, what's thw worst that could happen?"

BA-BOOOOOOOOOOOOM!


My DBP plugins page is now hosted [href]here[/href]
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Sep 2007 04:17
That sounded like a recipe for contention.

I think because the screen "Device" is one chunk of ram when you get past the hoopla - it boils down to multi-threading for display stuff ends up needing sync anyway before each cycle/display sync.

I don't think this is where multi-threading would be really cool.
(Because all the threads would halt during the "commit" of the "screen" device" giving you actual threading work for a bit - halt - screen/sync - thread again etc... plus this scenario coupled with the overhead for threading in the first place - if not using affinity - (Selecting specific CPU's) would be counter productive - especially because each thread needs to "give up" the CPU voluntarily of they are all going to purr nicely. If your program has two threads that need to hustle, you best have them on two processors (via intel dual/quad magic architecture or literal processors)

I think if you DO have multi-processors available - and you weant to do background stuff like fetching graphics, AI that's not directly in the "close up gameplay" and stuff like that - that's cool.. and I bet you could do that in along side DarkGDK via OS calls. I wouldn't expect DirectX to multi-task well with regards to the screen and/or onscreen objects being manipulated by multiple threads simulatanteously - I think it would chug.

However I think in DirectX native - it might be something that is more doable in a multiple display scenario - two separate "device context" - I could see that working rather swell - one thread has one "display" and 3d stuff it handles and the other another.

Login to post a reply

Server time is: 2024-11-16 20:26:27
Your offset time is: 2024-11-16 20:26:27