Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • wittgen/is
  • ssnyder/is
  • atlas-tdaq-software/is
3 results
Show changes
Commits on Source (3)
......@@ -136,7 +136,7 @@ int main(int argc, char ** argv)
CmdLine cmd(*argv, &partition_name, &server_name, &person_name, &employee_name, NULL);
CmdArgvIter arg_iter(--argc, ++argv);
cmd.description("This program implements fanctionality tests for the Information Service.\n"
cmd.description("This program implements functionality tests for the Information Service.\n"
"It creates, updates and deletes information objects.");
// Parse arguments
......
......@@ -307,6 +307,7 @@ ISInfoDynAny::setAttributeValue( const std::string & name, const T & value )
inline std::ostream &
operator<<( std::ostream & out, const ISInfoDynAny & val )
{
std::vector<int, std::allocator<int>> ii;
return val.print( out );
}
......@@ -327,7 +328,7 @@ namespace std {
;
}
void deallocate(ISInfoDynAny *p, std::size_t n) {
void deallocate(ISInfoDynAny *p, std::size_t ) {
::operator delete(p);
}
......
......@@ -49,6 +49,7 @@ private:
static const size_t m_max_length;
ISRepository & m_repository;
std::vector<boost::shared_ptr<ISInfoHolder>> m_selected;
ISCriteriaHelper m_criteria;
is::stream_var m_stream;
const std::string m_stream_id;
......
......@@ -49,46 +49,56 @@ void
ISStreamHelper::fill()
{
ERS_LOG("creating " << m_stream_id << " with history_depth = " << m_history_depth);
const ISInfoSet * set;
{
ISRepository::DataLock data_lock(m_repository, set);
ERS_DEBUG(1, "Acquired data lock for " << m_stream_id);
m_selected.reserve(set->size());
for (ISInfoSetSorted::const_iterator it = set->get<1>().begin();
it != set->get<1>().end(); ++it)
{
if (m_criteria.match((*it)->name(), (*it)->type()))
{
m_selected.push_back(*it);
}
}
}
ERS_DEBUG(1, m_stream_id << " data lock was released");
boost::thread send_thread(boost::bind(&ISStreamHelper::send, this));
m_buffers[0] = new is::info_list(m_max_length, 0, new is::info_history[m_max_length]);
m_buffers[1] = new is::info_list(m_max_length, 0, new is::info_history[m_max_length]);
const ISInfoSet * set;
size_t length = 0;
for (const auto & info : m_selected)
{
ISRepository::DataLock data_lock(m_repository, set);
ERS_DEBUG(1, "Acquired data lock for " << m_stream_id);
size_t length = 0;
for (ISInfoSetSorted::const_iterator it = set->get<1>().begin();
it != set->get<1>().end(); ++it)
{
const boost::shared_ptr<ISInfoHolder> & info = *it;
if (m_criteria.match(info->name(), info->type()))
{
length += push(info);
if (length >= m_max_length)
{
ERS_DEBUG(1, "Buffer is full, let's wait for the sending thread");
std::unique_lock lock(m_mutex);
m_condition.wait(lock, [this]{return m_ready_to_send;});
}
}
if (m_ready_to_send && m_buffers[m_fill_buffer]->length())
{
if (m_error) {
break;
}
std::unique_lock lock(m_mutex);
ERS_DEBUG( 1, "IS stream " << m_stream_id << " is ready to send data: "
<< m_buffers[m_fill_buffer]->length());
m_send_buffer = m_fill_buffer;
m_fill_buffer = !m_send_buffer;
m_ready_to_send = false;
length = 0;
m_condition.notify_one();
}
}
length += push(info);
if (length >= m_max_length)
{
ERS_DEBUG(1, "Buffer is full, let's wait for the sending thread");
std::unique_lock lock(m_mutex);
m_condition.wait(lock, [this]{return m_ready_to_send;});
}
if (m_ready_to_send && m_buffers[m_fill_buffer]->length())
{
if (m_error) {
break;
}
std::unique_lock lock(m_mutex);
ERS_DEBUG( 1, "IS stream " << m_stream_id << " is ready to send data: "
<< m_buffers[m_fill_buffer]->length());
m_send_buffer = m_fill_buffer;
m_fill_buffer = !m_send_buffer;
m_ready_to_send = false;
length = 0;
m_condition.notify_one();
}
}
if (!m_error)
{
std::unique_lock lock(m_mutex);
......