|
Re: How to use thread in papyrus-rt application and are there more samples projects? [message #1737997 is a reply to message #1737923] |
Thu, 14 July 2016 19:30 |
|
Note that the Top.Controller file is a temporary measure until we implement threading support within the Papyrus-RT. It is provided for experimentation only and it will be replaced once with implement a better thread mapping capability.
The Top.Controller file is used to map a capsule role to an OS thread.
The syntax within that file is "[capsule|capsulePart] = OSThreadName". Each assignment needs to be on its own line.
For example:
Top = TopController => The runtime creates the "TopController" OS thread and assigns the Top capsule it.
Top.pinger = =PingerController => The runtime creates the "PingerController" OS thread and assigns the "pinger" capsule part from the Top capsule to it.
The "LEDEmbedded" model was meant to illustrate a design pattern to interface to hardware and was not meant to be executable.
We have not yet decided how we will approach the concept of "logical threads" and handle its migration to Papyrus-RT. This will be implemented as part of the "thread mapping" capability mentioned above.
There are more sample models available in the Papyrus-RT git repository under models/samples folder (org.eclipse.papyrus-rt/models/samples). Note that not all these models are complete. The largest runnable model in that folder is "ComputerSystem". That, along with PingPong, is the model I typically use for demos. Note that none of these models have been updated to the current Neon stream. As such, these models come with no guarantees. Current plan is to have them available from within Papyrus-RT when the project leaves incubation (i.e. at v1.0).
I hope this helps.
/Charles Rivet
|
|
|
|
Re: How to use thread in papyrus-rt application and are there more samples projects? [message #1738009 is a reply to message #1738008] |
Fri, 15 July 2016 03:21 |
|
For the time being, and until we get the thread mapping capability in the tool, the generated code should not change. Since it is mainly a way for us to test threads and cross-thread communications, the Top.controller file is used directly by the runtime if it exists, which is why it is expected to be in the same location as the executable to be run, i.e., by default where the code is generated. There is actually a command line debug API that lets a user specify alternative thread assignment files at startup (as well as dumps of interesting information.
I thought this information had been placed in the wiki, but I can't find it. I'll get it up there as soon as possible.
/Charles Rivet
|
|
|
Re: How to use thread in papyrus-rt application and are there more samples projects? [message #1738020 is a reply to message #1738009] |
Fri, 15 July 2016 06:56 |
xiaoyu qu Messages: 5 Registered: July 2016 |
Junior Member |
|
|
I tried the CLI input of PingPong application,
>cat Top.Controllers
Top = TopController
Top.pinger = PingerController
Top.ponger = PongerController
Run the PingPong app,
~/workspace-papyrus/PingPong_CDTProject/src > ./TopMain -c./Top.Controllers
However, still only one busy thread can be seen in output of "top -p + H"command.
I do not know what is the problem.
By the way, I used Papyrus-RT 0.7.2.
I've clone 1.0.1 source code, there are many examples there. And seem my Top.Controllers is right, Maybe the 0.7.2 version TopMain does not support the -c option?
BR/Xiaoyu
[Updated on: Fri, 15 July 2016 07:23] Report message to a moderator
|
|
|
Re: How to use thread in papyrus-rt application and are there more samples projects? [message #1738105 is a reply to message #1738020] |
Fri, 15 July 2016 17:55 |
|
Hi Xiaoyu,
It may depend on the updates you applied to your installation. There is a point where the way that functionality worked was modified.
Do you have a copy of Top.controllers in the same folder as your model? If not, I would suggest placing one there.
You may also be interested in trying the new Mars.1/Neon Stream of Papyrus-RT. Check out the tester installation from the Papyrus-RT wiki if you are interested.
/Charles Rivet
|
|
|
Re: How to use thread in papyrus-rt application and are there more samples projects? [message #1738203 is a reply to message #1738105] |
Mon, 18 July 2016 06:39 |
xiaoyu qu Messages: 5 Registered: July 2016 |
Junior Member |
|
|
Hi, Charles,
After I put Top.controllers under the model root directory, the C++ generated code had all the configured thread controllers.
The running result also proved the capsule has been assigned to a new thread.
I am working on some pilot testings on Papyrus-RT formal release, not it is 0.7.2. Seems it can satisfy our expectation.
Later, I will continue to try the example in tester installation, and recommend Papyrus-RT to our team, later may contruct applications on top of it.
As an C++ programer, I feel model driven tools are very attractive, and open source will give them a brilliant future.
Thanks again for your help.
BR/Xiaoyu
|
|
|
Powered by
FUDForum. Page generated in 0.05277 seconds