Friday, 15 June 2012

c++ - Boost: what exactly is not threadsafe in Boost.Signals? -


I read Boost in many places. There is no signal thread but I have not got much information about it. This simple quote does not really say much in most applications today, threads are present - even if they try to be single-threaded, they may use some libraries threads (for example, libsdl).

I think there is no problem with the other threads in the implementation slot. So this is the least thread in this sense.

But what really works and what will not work? Will it work to use it with many threads, as long as I never access it at the same time? To wit. If I create my own mutex around the slot?

Do I have to use slots in that thread where I made it? Or where did I use it for the first time?

I do not think it's very clean, and a library reviewer:

I also did not like that only three times the word 'Thread' was given the name Boost.signals2 wants to be the 'Thread Safe Signals' library, hence some more details and more specifically about that area Example user Should be given to.

There is a way to detect it and see if they are using _mutex / lock () to protect. So just think what would happen if those were not in the calls? :)

Whatever I can collect, it is to ensure simple things such as "If a thread adds or disconnects, then it will not cause a separate thread to crash Those signals are running through the slots connected. " How does using a thread-safe version of a kind of library assure you that if two threads do valid call to printf at the same time, then crash will not be (not to say that The output will not make any sense to you & mdash; you are still responsible for high order semantic.)

It does not look like a QT, in which the thread runs a certain slot code, the target Slot's "Thread Announcement" (Junk This means that a signal can be triggered to run the slot in parallel on many different threads to emit). But I think it's not an estimate of supporting it. Promotion: The signs can be "coordinator".


No comments:

Post a Comment