|
Re: boost up you game... (use multithreading!)
[Re: EvilSOB]
#258240
03/28/09 19:46
03/28/09 19:46
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
... directx vertex manipulations and entity texture changes(ent_setskin)? you can NOT use engine functions in other threads
3333333333
|
|
|
Re: boost up you game... (use multithreading!)
[Re: Quad]
#258243
03/28/09 20:08
03/28/09 20:08
|
Joined: Jun 2008
Posts: 151 Ukraine
XD1v0
Member
|
Member
Joined: Jun 2008
Posts: 151
Ukraine
|
Quadraxas did you know is jcl testing multithreading on Lite-C? you can NOT use engine functions in other threads But how about ditectx functions(d3d9.h), can I use this functions?
Last edited by XD1v0; 03/28/09 21:26.
A7 Commercial Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
|
|
|
Re: boost up you game... (use multithreading!)
[Re: Quad]
#258385
03/30/09 06:40
03/30/09 06:40
|
mercuryus
OP
Unregistered
|
mercuryus
OP
Unregistered
|
Is multithreading integrated in Lite-c,I do not understand can I use multithreading in every system and any processor? Or multithreading may crash in some systems. multithreading is a technique of the operating system (windows, unix, ...) I can't speak for all types of systems/processors but every Intel(r) compatible prozessor (Intel/AMD) and all Windows(r) operating systems from Windows 98 support multithreading. Since 3DGS only supports Windows(r) multithreading will run on every clients target plattform (with different performance). But there is a difference between multithreading-support of the engine and lite-c! The engine actually DON'T use multithreading but you're able to create multithreading applications with lite-c (see the example) yourself. The main challenge of multithreading applications is the synchronisation of the results of the different threads but once your concept works well the benefit could be extensive (especially with the new generation of multi-core processor systems!) I discovered that I/O-handling (file/video/sound) in more than one thread ends in a crash (and more!*) especial in multi-core-systems. mercuryus *) backup your system before playing with multithreading programming!
|
|
|
Re: boost up you game... (use multithreading!)
[Re: ]
#258406
03/30/09 13:14
03/30/09 13:14
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
Expert
|
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
so CreateThread just... works? that's interesting, i haven't thought that lite-c was that much compatible to native c code. You can take a peek in windows.h in your gamestudio folder and see what other hidden miracles are available  . Multithreading is a must for calling a database realtime, if you don't want any stuttering. I think Lite-C simply ports it from your windows.h, together with alot of other useful functions. Great contribution Mercuryus! Regards, Joozey
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: boost up you game... (use multithreading!)
[Re: Gumby22don]
#258490
03/31/09 01:29
03/31/09 01:29
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
Expert
|
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
You can only have a maximum of X many threads on windows systems. The default virtual space a thread consumes is 1Meg, and if you're not careful, your pc could end up being very busy for a long time. I suggest you create as few threads as possible, only use them when there's no way around, such as a database query. But even so you only need one extra thread for an unlimited amount of database connection. Pending queries may be stacked. I'm not sure what you mean with "data_locked", AFAIK you don't need to lock anything.
Last edited by Joozey; 03/31/09 01:35.
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
|