PDA

View Full Version : Any programmers out there?


vfilby
30th of October 2004 (Sat), 21:40
I need to bounce some ideas w.r.t asynchronous image loading. Just a design problem if some one wants to lend an ear.

Woo, post #499...

Jesper
31st of October 2004 (Sun), 01:28
I need to bounce some ideas w.r.t asynchronous image loading. Just a design problem if some one wants to lend an ear.

Woo, post #499...

In what programming language, what operating system, what exactly do you want to accomplish etc.?

steven
31st of October 2004 (Sun), 20:06
You look at jobs of those who are willing to say and there are a great many programmers that are on this forum.

Camera -> Computers -> Programmers -> geeks

all appears to be related :D

vfilby
31st of October 2004 (Sun), 22:41
Well here is the problem, what do you guys think?

I need to load a whole bunch of images for a program (possibly 100's), so I created an image manager class that spawns image loader threads, all the while making sure there arn't too many threads at once.

My problem is whether to have the ImageConsumer (or observer in java) notify the manager class or the gui. The app is written in qt/c++ and the image loading is accomplished by the asyncimageio qt libraries.

Any thoughts?

vfilby
31st of October 2004 (Sun), 22:42
You look at jobs of those who are willing to say and there are a great many programmers that are on this forum.

Camera -> Computers -> Programmers -> geeks

all appears to be related :D

Agreed. I think it is also funny, but there seems to be a corelation between geeks and musicians.

Jesper
1st of November 2004 (Mon), 03:13
Programming in C++ on Unix, Linux? I know C++ but I've never used Qt or the library you mention.

Your description is short, so I don't know exactly what your design looks like, but my first hunch is to keep the GUI separate from the business logic (remember Model / View / Controller) - so probably you want the threads to notify the manager class.

(p.s. I did a lot of C++ programming on Windows a few years ago, but since about 1999 I'm developing Internet applications mainly in Java).

vfilby
1st of November 2004 (Mon), 08:42
Yeah, to me it made the most sense to have the threads notify the manager and then implement some generic way of notifying a widget.

The benefit with that scheme is that the manager manages all the loading details, otherwise you would need to do that and it would only manage the threads.

My only worry is possible problems the multi-threading might cause. I am not used to programming with threads.

Thanks,

steven
1st of November 2004 (Mon), 09:39
Read your descriptions but still not too sure what you are doing.

The images you are loading, into memory?, are then being used by another thread / widget ?

For multi threaded programs your point of concern will be data structures that multipule threads are going to touch. One approach would be to have one clase handle these comon structures and then that class would be responsible for serializing access (some type of lock).

More detail will on the design will likely make more specific recomendations possible.