Hi, I have a problem, because I have a list, in which I'd like to be able to add and remove components, but in other thread I use components from this list. Is there a safe way to operate over this list? Would using synchronized functions (one for drawing, one for modifying help?
Kam_1 -3
Newbie Poster
Recommended Answers
Jump to PostYou could synchronise drawing and modifying, but that would prevent them running concurrently and immediately halve the performance of the app and make the UI less responsive (not to mention the complexity and overhead of all that synch).
So if you just want to loop thru the list while drawing, …
Jump to PostNot sure why, but something seems uncomfortable about moving Cars around like that. I guess the code gets quite tangled?
How about just keeping a list of Cars, and having current location (instance of Lane or Intersection) as an instance member of Car?
My guess is that it would work …
All 5 Replies
JamesCherrill 4,733
Most Valuable Poster Team Colleague Featured Poster
Kam_1 -3
Newbie Poster
JamesCherrill 4,733
Most Valuable Poster Team Colleague Featured Poster
Kam_1 -3
Newbie Poster
JamesCherrill 4,733
Most Valuable Poster Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.