Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: Iterator loop where list being iterated changes in diff thread?
Topic Summary: I am having crashes due to corrupted iterator
Created On: 15-Oct-2008 19:15
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 15-Oct-2008 19:15
User is offline View Users Profile Print this message


Paul Coene

Posts: 8
Joined: 7-May-2008

A question:

I have two active classes (instances run in their own threads). Call these classes A and B. One instance of each is running, and A can have 0-many Bs, so A has an ItsB.

The instance of class A, in thread 1, makes a call to a method of the instance of Class B.

So that method code is running in thread 1. That call ends up sending an event to the instance if class B. That event will send class B to its termination node (T).

Class A, right after making that call, tries to increment his itsB iterator.

++itsB;

Sometimes, this results in a crash.

So, what it feels like to me, is the method running in thead 1 generates the event to class B. Class B somehow gets priority and terminates itself, and this the itsB interator in A is corrupt?

How do I handle this?

I always seem to have problems with iterators when entries and up deleted.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.