I’m having hassle attempting to symbolize some multithread course of and I might admire some recommendation.
Please let me clarify this with code. (in C++’ish as a result of that’s what I’m acquainted however take into account it simply pseudo code- it’s simple to know)
Say I’ve two lessons MainClass.cpp and ElementClass.cpp
the MainClass
has as a component an object of ElementClass
class MainClass{
MainClass:myElement(); // The myElement is constructed when the MainClass is constructed
method1()
{
myElement.method1();
}
method2();
ElementClasss myElement;
}
and
class ElementClass{
ElementClass():thread_handler(&separateThreadMethod){}
method1();
void separateThreadMethod()
{
name MainClass method2();
}
}
In order you possibly can see when an object of MainClass
is constructed , its MyElement
can be constructed and it initiates one other thread that runs separateThreadMethod
.
The MainClass object is saved spinning so its method1
may be referred to as at any time. This additionally calls myElement.method1()
In order you possibly can see there are two threads. Nonetheless they each use elements of MainClass and ElementClass.
Now I wish to symbolize this in a Diagram and I’m questioning how.
Initially I used Exercise Diagrams and I put completely different partitions for every thread in ElementClass
. I additionally put a special partition for MainClass
.
However MainClass
has strategies which can be referred to as by each threads so within the partition for MainClass
there may be not a transparent line of course of.
Is there a greater strategy to symbolize this? Maybe eradicate representing the lessons and simply symbolize the threads?
Any recommendation shall be drastically apreciated