General questions regarding TANGO
|
|
---|---|
Hi there, While exercising with TANGO 8.1.2 (On Windows platform, mainly with PyTango and C++ API), some questions rose up. Documentation (The TANGO Control System Manual Version 8.1):
Thanks for your time. Kind regards, Cyrille. |
|
|
---|---|
|
Hi Cyrille, I try to answer your pytango related questions below. cgarino Yes, we are in luck in python. The threading and multiprocessing modules that come with python provide similar functionality to what you have in yat4tango. You can find across thread and across process objects like Queue, Event, Pipe, Pool of workers, etc. cgarino The PyTango interface to the Tango Logging system is very basic. I am afraid that the answer to all three questions is no. But this is mainly because nobody asked for it yet. There is no technical reason not to do it. I invite you to create a feature request in the tango source forge ticket system. cgarinoYou are welcome. Kind regards Tiago |
|
|
---|---|
Hi Cyrille, let me answer your question on "Serialization by device. […]" and client threads in the server: (o) every client connecting to a device server creates its own thread. This enables multithreading of clients on the server side. It also enable high performance of the server because it can process multiple clients simultaneously on a multi-core system. However when accessing physical hardware e.g. a serial line, it is not always a good idea to allow multiple clients to have simultaneous access. This is why TANGO implements different sereialisation models - BY_DEVICE, BY_CLASS, BY_SERVER and NONE. These models use a mutex to serialise client access to be only ONE client executing per device, per device class and per process. The last serialisation model allows multiple client access without any serialisation at all. This is useful for device server who need very high multi-client performance and who are thread safe e.g. the database device server. The documentation on threading in device servers is here: http://www.esrf.eu/computing/cs/tango/tango_doc/kernel_doc/ds_prog/node10.html#SECTION001030000000000000000 Hope that helps, Kind regards Andy |
|
|
---|---|
Hi Cyrille,Is Yat4TANGO.DeviceTask a good candidate or simple user worker thread is enough?Concerning your question about the yat4tango DeviceTask class, if you plan to handle Tango events in your Task, there’s an even better candidate: the yat4tango::EventsConsumerTask class. It’s just a specialization of DeviceTask with some “events consumer” features. It can optionally “auto setup” the event for the target attribute at registration (see yat4tango::SubscriptionAction::AUTO_CONFIGURE). Some hate that feature, some love it. Have a look to the provided “events_consumer_task” example (see. samples directory of the SVN trunk). Is there an equivalent of Yat4TANGO.DeviceTask implemented in PyTango?Both the DeviceTask and EventsConsumerTask are available for Python. It’s a pure Python implementation (i.e. doesn’t require the C++ yat4tango lib). Does LogAdapter exist in PyTango?I have a 'personal package' containing python implementation of the LogAdapter class. I could cleanup my code in order to turn it into public release of what could be called pyYat4Tango. Any interest? Nicolas. |
|
|
---|---|
Hi Cyrille Most of your questions have been answered already but not all of them: - There is only ONE thread executing event callback on the client side. The sentences you noticed in the documentation were true for Tango up to release 7 when the event system was the CORBA notification service. Now that we are using ZMQ, they are not valid any more. We have to update this part of the doc. Good catch! Note that in the ZMQ layer, thre is a bufferization of the incoming events in case of long running event callback. See doc chapter A 9.3 and A 12.3.5 - It is not possible to not execute the event callback at subscription time. This is the way Tango manages the late joiner pb. - In event push mode, the event queues are the ZMQ buffer (see first answer) - In the EventData instance that you get when you receive one event, it is the DeviceProxy instance of the device on which the subscription has been done which is received (Not the source, the receiver device) - I think it is possible to push events in one event callback Hoping this help Emmanuel |
|
|
---|---|
Thanks a lot for all these answers! Cyrille. |