There is an important issue that also must be considered in this
discussion. OpenGL is not multithreaded. So all opengl calls need to be
done in a single thread. Or if you split them out, you must make sure that
the API calls are automic *and* opengl is a state system so you can't
interleave calls from different threads ... it just doesn't work.
Imagine you are driving a car and have two passengers in the back seat. One
passenger wants to go to location A, and one passenger wants to go to
location B. They can only give you turn left/turn right type instructions.
If you do one at a time and are careful, you might successfully get to both
destinations in order. If you interleave their instructions, you will soon
do something that makes no sense (like turn left into a tree) and crash.
Life in the world of opengl is very similar.
In light of that, you must realize that the opengl model loaders make opengl
calls. So if player B enters the world with a whiz-bang complicated 200,000
polygon aircraft. You can't just trivially load that airplane in a separate
thread.
It is possible to make threaded model loaders, but now you are faced with
the task of completely re-writing the OSG or PLIB model loaders so they play
nice in a threaded environment in the context of our application. You have
to make sure that all the opengl calls are serialized in the correct order
so they don't step on each other and cause an application crash.
Anything is possible, but some things are very hard.
Curt.
On 4/10/07, Stefan Seifert wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Reagan Thomas wrote:
> I have seen some of the discussions regarding multi-threading and I
> understand the desire to limit the complexity of program flow. However,
> I think that at least *some* specific file IO should be arranged such
> that it is non-blocking for the main loop.
Non-blocking file IO does not necessarily mean multi-threading since
every platform, FlightGear runs on should have async I/O nowadays.
Nine
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFGG6pp1QuEJQQMVrgRCOlzAJ4nIgDfUTS/9Ihnc8ZRzJ6IKHJN3QCgg35A
MYukINsdAJhs8d0W2JPrix4=
=hTBT
-----END PGP SIGNATURE-----
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel
--
Curtis Olson - University of Minnesota - FlightGear Project
http://baron.flightgear.org/~curt/ http://www.humanfirst.umn.edu/
http://www.flightgear.org
Unique text: 2f585eeea02e2c79d7b1d8c4963bae2d
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel