Re: [Libphidget-devel] Documentation?
Status: Alpha
Brought to you by:
jstrohm
|
From: Jack S. <js...@ja...> - 2002-09-07 05:32:59
|
On Sat, 2002-09-07 at 00:20, Vadim Tkachenko wrote: > > > Maybe it is so in C++ world. However, speaking for myself, I've spent last 7 > > > years in Java and got eventually fed up with it for one simple reason: it's > > > BIG. OK, you can put together something in a day that you'd spend a month > > > doing in C++ (collections, threading, etc.), fine, but the weight of the > > > resulting code is just overwhelming. > > > > when you say weight, what do you mean? > > In particular, memory footprint. Speed is not encouraging, either. Maybe > it's just me with my tendency to write generic code and not optimize it, I > don't know. memory . . . you mean it takes more than 512 megs to run? I figure anything under 512 megs is pretty light ;-) > > > > And the real world applications of phidgets will most probably be MT. > > > > why do they need to be MT? > > 'cause it's simpler this way. I'd disagree about MT being simpler. Maybe the design might be simpler, but the implementation of the design can have a lot of snafu's > > > I always thought MT was very cool, but the large the system the harder > > MT seems to be to deal with. (specially if your OS has thread bugs, > > *solaris*, *windows*). > > OS bugs notwithstanding, but I've figured out a way to deal with threads. > Another project of mine, Jukebox, was multithreaded on OS/2 (the > implementation was C++ back then), then I've ported it to Java and I'm > afraid I've lost the C++ sources, but I'm seriously thinking about > implementing those patterns in C++ again, now that the collections are > basically standard (STL, right?). yep, we got vectors (like collections), sets (sorted collections), map (indexed collections) and a few more. I really like templates, although I sometimes don't like the consistency of the STL interface. > > > I'm actually having a threading issue in another project. A 3D graphics > > engine I wrote that has 2 threads. One draws everything, the other does > > all the heavy LOD > > What's LOD? Level of Detail. http://iris.homeip.net:8080/jstrohm/index.jsp?Page=geek ( *beware of shameless plug of other project ) > > > calculations. Runs very smooth in Linux. I ported it to windows and it > > is CRAP. the background thread gets schedules about every few seconds for > > about 100th of a second. If you increase the threads priority any it > > nearly locks the machine up cause the kernel can't get any time to > > process. > > Tried mutexes? Or event semaphores? Or the background calculations are > *really* non-stop? Give me a little while, I might be able to help you with > that... Actually I designed it so it doesn't share much data between the two threads so only one spot requires mutexes and it only get's called every once in awhile. So if you got 2 CPU's 99.9% of the time it never waits on the other thread. Basically I lock mutex, change pointer to world data, unlock mutex (kinda) I think the slowdown in windows is just bad OS. It works GREAT in linux, it's probably about 2 to 3 times faster (on the same machine) |