Ask a Question | Search DSPSR: |
Home
|
dsp::FoldManager Class Reference Manage multiple Fold operations. More...
Inheritance diagram for dsp::FoldManager:
Detailed DescriptionManage multiple Fold operations. The original intent for this class was to implement a solution to a thread deadlock issue. However, in the end, 1) this class currently has a bug in it (see https://sourceforge.net/p/dspsr/bugs/93/); and 2) the thread deadlock issue was solved in a different way. When a thread reaches the end of a sub-integration, there are two possibilities: a. the sub-integration is complete and can be written to disk; or b. the sub-integration is incomplete because one or more threads still have data to fold into it (and have yet to do so). In case b, there are a couple of options:
Option 1 is not very friendly on RAM, especially if sub-integration data are somewhat large (e.g. many channels) and there are many pulsars to fold. Therefore, dspsr implements option 2. However, when there are multiple folds happening in parallel, different threads can go to sleep waiting for sub-integrations to be completed on different pulsars, and in the case of two threads it is possible for thread A to be waiting on pulsar X and thread B to be waiting on pulsar Y (deadlock). It is simplest to use option 1, but this could lead to large numbers of cloned sub-integrations waiting around to be completed. I guess that there would be at most nthread cloned sub-integrations, and perhaps this is not terrible in most cases. Another approach is to stick to option 2 but link the different Fold transformations with pointers to each other, such that a thread will go and finish other Fold operations (and wake up any other sleeping threads) before going to sleep on its current Fold. I like option 2 best and started working on this class to manage the links. In the end, I went with option 1. Before option 2 can be attempted using this class, the bug in this class must be fixed. The documentation for this class was generated from the following files:
Generated using doxygen 1.8.17
|