B4 allows you to program more than one concurrently running operation. For each of the actions the program defines a new thread. One Baltie had better not to perform the tasks in two threads running at the same time. He would alternately perform the tasks for both threads so its behavior could seem to be a quite chaotic.
  Balties
Be careful when you run the program with multiple threads. The threads should not share one Baltie, otherwise its behavior could become chaotic. It is strongly recommended to use a different Baltie in each of the concurrently running threads, which have any impact on a scene animation.
Just for such kinds of tasks, B4 offers you to use a few independent Balties, which differ to each other by the color of their coats.
 Set Baltie - It opens a pull down list of the commands for particular colors of Balties. You can choose a Baltie from the list, whom you will give orders to. There are 10 Balties available, which differ from each other just by the color of their coats.
A set of the available commands for Baltie's control changes when you select a new Baltie. A user can choose the command either directly from the opened list of the command set, or as usual from the tool bar anytime later.
Was this helpful?
  Running an independent thread
To run an independent thread use the Following command will be executed in parallel (in a new thread). This command expects to be followed by command (the most usually a method call), which should be executed in a separate thread.
When the command is executed, the following command (or a command block) will be run in a new thread. That means the program will not wait until the program is finished, but it continues in the execution.
By running more tasks in independent threads you can achieve that all the tasks will be performed seemingly concurrently (They will be run even really concurrently on the multiprocessor computers).
A collateral performance of more actions may introduce some pitfalls, related mostly to the need of a thread synchronization. This issue becomes very important when the threads access some shared resources.
Was this helpful?
Thread synchronization
B4 implements a concept of the synchronization via sending messages and waiting for messages.
 Send Text - Baltie sends a text message to a Baltie, or to all Balties.
After assigning this command B4 opens a dialog at first. Here you can specify a Baltie (just one or all Balties) which the current Baltie will send the text to.
When you assign a recipient, an envelope picture behind Baltie on the command icon gets its color. After then a text cursor will appear on the next icon, waiting for you to specify the text being sent. You can finish a text edition by clicking outside the icon.
Example (For modes 2D, 3D)
If you want to change the color of the recipient Baltie, just click on the icon. The dialog for choosing Baltie will arise again.
If you want to change the text of the message being sent, just click on the icon with the text. The icon switches to the edit mode and you can change the text.
 Wait for Text - Baltie will await until he receives a text message from the particular Baltie, or from any Baltie.
After assigning this command B4 opens a dialog at first. Here you can specify a Baltie (just one or all Balties) which the current Baltie will wait a message from (the same window as for the previous command).
When you assign a sender, a document picture behind Baltie on the command icon gets its color. After then a text cursor will appear on the next icon, waiting for you to specify the text being received. You can finish, a text edition by clicking outside the icon.
In the following picture you can see the command for the red Baltie to wait for the message from the violet Baltie, shown in the previous picture.
Example (For modes 2D, 3D)
If you didn't specify the text of message being received, he would wait for any message from the particular Baltie.
Later, if you want to change the color of the Baltie, which you are awaiting a message from, just click on the icon and the dialog for choosing Baltie opens again.
If you want to change the text of the message being received, just click on the icon with the text. The icon switches to the edit mode and you can change the text.
Was this helpful?


Did you find this information useful?
Documentation of SGP Baltie 4 C#
Send us comments on this topic by this form ©1978-2010 SGP Systems

Parent page | Previous page | Next page