Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SLI sleep function (fixes #973) #976

Merged
merged 4 commits into from
Jul 3, 2018

Conversation

heplesser
Copy link
Contributor

@heplesser heplesser commented Jun 17, 2018

Revise implementation of sleep to work correctly with 32-bit signed int; remove duplicity of implementation for int and double arg. This eliminates a warning about narrowing, which is an error in strict C++11.

Also, it seemed that sleep times given as doubles were not handled correctly in the past, e.g. 2.75 s.

This fixes #973.

remove duplicity of implementation for int and double arg.
@heplesser heplesser requested review from jougs and hakonsbm and removed request for jougs June 17, 2018 22:50
@heplesser heplesser added ZC: Interpreter DO NOT USE THIS LABEL ZP: PR Created DO NOT USE THIS LABEL S: High Should be handled next T: Maintenance Work to keep up the quality of the code and documentation. I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) labels Jun 17, 2018
@heplesser heplesser added this to the NEST 2.16 milestone Jun 17, 2018
Copy link
Contributor

@hakonsbm hakonsbm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good, but see my comment.

{
throw BadParameterValue( String::compose(
"t < %1s required.", std::numeric_limits< int >::max() ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be t <=?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The limit is around 68 years (for 32-bit int), so I think it does not really matter much and avoids any potential corner cases. Therefore, I chose the simpler <.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright 👍

@heplesser
Copy link
Contributor Author

@espenhgn Could you check if this works for you?

@espenhgn
Copy link
Contributor

Hi,
Following my procedure from earlier; this change set results in other warnings and finally an error (while it takes care of the sleep function):

$ make
[  0%] Building CXX object libnestutil/CMakeFiles/nestutil.dir/stopwatch.cpp.o
[  0%] Building CXX object libnestutil/CMakeFiles/nestutil.dir/numerics.cpp.o
[  1%] Building CXX object libnestutil/CMakeFiles/nestutil.dir/propagator_stability.cpp.o
[  1%] Building CXX object libnestutil/CMakeFiles/nestutil.dir/logging_event.cpp.o
[  2%] Linking CXX shared library libnestutil.dylib
[  2%] Built target nestutil
[  2%] Building CXX object sli/CMakeFiles/sli_lib.dir/allocator.cpp.o
[  3%] Building CXX object sli/CMakeFiles/sli_lib.dir/arraydatum.cc.o
[  3%] Building CXX object sli/CMakeFiles/sli_lib.dir/booldatum.cc.o
[  4%] Building CXX object sli/CMakeFiles/sli_lib.dir/charcode.cc.o
[  4%] Building CXX object sli/CMakeFiles/sli_lib.dir/datum.cc.o
[  5%] Building CXX object sli/CMakeFiles/sli_lib.dir/dict.cc.o
[  5%] Building CXX object sli/CMakeFiles/sli_lib.dir/dictdatum.cc.o
[  5%] Building CXX object sli/CMakeFiles/sli_lib.dir/dictstack.cc.o
[  6%] Building CXX object sli/CMakeFiles/sli_lib.dir/dictutils.cc.o
[  6%] Building CXX object sli/CMakeFiles/sli_lib.dir/doubledatum.cc.o
[  7%] Building CXX object sli/CMakeFiles/sli_lib.dir/fdstream.cc.o
[  7%] Building CXX object sli/CMakeFiles/sli_lib.dir/filesystem.cc.o
[  7%] Building CXX object sli/CMakeFiles/sli_lib.dir/functiondatum.cc.o
[  8%] Building C object sli/CMakeFiles/sli_lib.dir/get_mem.c.o
[  8%] Building CXX object sli/CMakeFiles/sli_lib.dir/integerdatum.cc.o
[  9%] Building CXX object sli/CMakeFiles/sli_lib.dir/interpret.cc.o
[  9%] Building CXX object sli/CMakeFiles/sli_lib.dir/iostreamdatum.cc.o
[  9%] Building CXX object sli/CMakeFiles/sli_lib.dir/iteratordatum.cc.o
[ 10%] Building CXX object sli/CMakeFiles/sli_lib.dir/literaldatum.cc.o
[ 10%] Building CXX object sli/CMakeFiles/sli_lib.dir/name.cc.o
[ 11%] Building CXX object sli/CMakeFiles/sli_lib.dir/slinames.cpp.o
[ 11%] Building CXX object sli/CMakeFiles/sli_lib.dir/namedatum.cc.o
[ 11%] Building CXX object sli/CMakeFiles/sli_lib.dir/oosupport.cc.o
[ 12%] Building CXX object sli/CMakeFiles/sli_lib.dir/parser.cc.o
[ 12%] Building CXX object sli/CMakeFiles/sli_lib.dir/processes.cc.o
[ 13%] Building C object sli/CMakeFiles/sli_lib.dir/psignal.c.o
[ 13%] Building CXX object sli/CMakeFiles/sli_lib.dir/scanner.cc.o
[ 14%] Building CXX object sli/CMakeFiles/sli_lib.dir/sli_io.cc.o
[ 14%] Building CXX object sli/CMakeFiles/sli_lib.dir/sliactions.cc.o
[ 14%] Building CXX object sli/CMakeFiles/sli_lib.dir/sliarray.cc.o
[ 15%] Building CXX object sli/CMakeFiles/sli_lib.dir/slibuiltins.cc.o
[ 15%] Building CXX object sli/CMakeFiles/sli_lib.dir/slicontrol.cc.o
[ 16%] Building CXX object sli/CMakeFiles/sli_lib.dir/slidata.cc.o
[ 16%] Building CXX object sli/CMakeFiles/sli_lib.dir/slidict.cc.o
[ 16%] Building CXX object sli/CMakeFiles/sli_lib.dir/sliexceptions.cc.o
[ 17%] Building CXX object sli/CMakeFiles/sli_lib.dir/sligraphics.cc.o
[ 17%] Building CXX object sli/CMakeFiles/sli_lib.dir/slimath.cc.o
[ 18%] Building CXX object sli/CMakeFiles/sli_lib.dir/slimodule.cc.o
[ 18%] Building CXX object sli/CMakeFiles/sli_lib.dir/sliregexp.cc.o
[ 18%] Building CXX object sli/CMakeFiles/sli_lib.dir/slistack.cc.o
[ 19%] Building CXX object sli/CMakeFiles/sli_lib.dir/slistartup.cc.o
[ 19%] Building CXX object sli/CMakeFiles/sli_lib.dir/slitype.cc.o
[ 20%] Building CXX object sli/CMakeFiles/sli_lib.dir/slitypecheck.cc.o
[ 20%] Building CXX object sli/CMakeFiles/sli_lib.dir/specialfunctionsmodule.cc.o
[ 20%] Building CXX object sli/CMakeFiles/sli_lib.dir/stringdatum.cc.o
[ 21%] Building CXX object sli/CMakeFiles/sli_lib.dir/symboldatum.cc.o
[ 21%] Building CXX object sli/CMakeFiles/sli_lib.dir/tarrayobj.cc.o
[ 22%] Building CXX object sli/CMakeFiles/sli_lib.dir/token.cc.o
[ 22%] Building CXX object sli/CMakeFiles/sli_lib.dir/tokenarray.cc.o
[ 23%] Building CXX object sli/CMakeFiles/sli_lib.dir/tokenstack.cc.o
[ 23%] Building CXX object sli/CMakeFiles/sli_lib.dir/tokenutils.cc.o
[ 23%] Building CXX object sli/CMakeFiles/sli_lib.dir/triedatum.cc.o
[ 24%] Building CXX object sli/CMakeFiles/sli_lib.dir/typechk.cc.o
[ 24%] Building CXX object sli/CMakeFiles/sli_lib.dir/utils.cc.o
[ 25%] Linking CXX shared library libsli.dylib
[ 25%] Built target sli_lib
[ 25%] Building CXX object librandom/CMakeFiles/random.dir/binomial_randomdev.cpp.o
[ 26%] Building CXX object librandom/CMakeFiles/random.dir/exp_randomdev.cpp.o
[ 26%] Building CXX object librandom/CMakeFiles/random.dir/gamma_randomdev.cpp.o
[ 27%] Building CXX object librandom/CMakeFiles/random.dir/gsl_binomial_randomdev.cpp.o
[ 27%] Building CXX object librandom/CMakeFiles/random.dir/gslrandomgen.cpp.o
[ 27%] Building CXX object librandom/CMakeFiles/random.dir/knuthlfg.cpp.o
[ 28%] Building CXX object librandom/CMakeFiles/random.dir/librandom_names.cpp.o
[ 28%] Building CXX object librandom/CMakeFiles/random.dir/lognormal_randomdev.cpp.o
[ 29%] Building CXX object librandom/CMakeFiles/random.dir/mt19937.cpp.o
[ 29%] Building CXX object librandom/CMakeFiles/random.dir/normal_randomdev.cpp.o
[ 30%] Building CXX object librandom/CMakeFiles/random.dir/poisson_randomdev.cpp.o
[ 30%] Building CXX object librandom/CMakeFiles/random.dir/random.cpp.o
[ 30%] Building CXX object librandom/CMakeFiles/random.dir/random_numbers.cpp.o
[ 31%] Building CXX object librandom/CMakeFiles/random.dir/randomdev.cpp.o
[ 31%] Building CXX object librandom/CMakeFiles/random.dir/randomgen.cpp.o
[ 32%] Building CXX object librandom/CMakeFiles/random.dir/uniform_randomdev.cpp.o
[ 32%] Building CXX object librandom/CMakeFiles/random.dir/uniformint_randomdev.cpp.o
[ 32%] Linking CXX shared library librandom.dylib
[ 32%] Built target random
[ 33%] Building CXX object librandom/CMakeFiles/randomtest.dir/randomtest.cpp.o
[ 33%] Linking CXX executable randomtest
[ 33%] Built target randomtest
[ 34%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/archiving_node.cpp.o
[ 34%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/common_synapse_properties.cpp.o
[ 34%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/sibling_container.cpp.o
[ 35%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/subnet.cpp.o
[ 35%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/connector_base.cpp.o
[ 36%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/connector_model.cpp.o
[ 36%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/connection_id.cpp.o
[ 36%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/device.cpp.o
[ 37%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/dynamicloader.cpp.o
[ 37%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/event.cpp.o
[ 38%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/exceptions.cpp.o
[ 38%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/gid_collection.cpp.o
[ 38%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/histentry.cpp.o
[ 39%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/model.cpp.o
[ 39%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/model_manager.cpp.o
[ 40%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/nest_datums.cpp.o
[ 40%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/nest_names.cpp.o
[ 41%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/nestmodule.cpp.o
[ 41%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/nest_time.cpp.o
[ 41%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/nest_timeconverter.cpp.o
[ 42%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/modelrange.cpp.o
[ 42%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/modelrange_manager.cpp.o
[ 43%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/multirange.cpp.o
[ 43%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/node.cpp.o
[ 43%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/nodelist.cpp.o
[ 44%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/proxynode.cpp.o
[ 44%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/recording_device.cpp.o
[ 45%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/ring_buffer.cpp.o
[ 45%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/spikecounter.cpp.o
[ 45%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/sparse_node_array.cpp.o
[ 46%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/conn_parameter.cpp.o
[ 46%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/conn_builder.cpp.o
[ 47%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/music_event_handler.cpp.o
[ 47%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/music_manager.cpp.o
[ 48%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/nest.cpp.o
In file included from /Users/ehagen/Repositories/nest-simulator/nestkernel/nest.cpp:31:
/Users/ehagen/Repositories/nest-simulator/nestkernel/mpi_manager_impl.h:95:20: warning: instantiation of variable 'MPI_Type<long>::type' required here, but no definition is available
      [-Wundefined-var-template]
    MPI_Type< T >::type,
                   ^
/Users/ehagen/Repositories/nest-simulator/nestkernel/mpi_manager_impl.h:139:7: note: in instantiation of function template specialization
      'nest::MPIManager::communicate_Allgatherv<long>' requested here
      communicate_Allgatherv< long >(
      ^
/Users/ehagen/Repositories/nest-simulator/nestkernel/nest.cpp:385:26: note: in instantiation of function template specialization
      'nest::MPIManager::communicate<nest::LocalNodeListBase<nest::LocalNodeListIterator> >' requested here
    kernel().mpi_manager.communicate(
                         ^
/Users/ehagen/Repositories/nest-simulator/nestkernel/mpi_manager_impl.h:82:23: note: forward declaration of template entity is here
  static MPI_Datatype type;
                      ^
/Users/ehagen/Repositories/nest-simulator/nestkernel/mpi_manager_impl.h:95:20: note: add an explicit instantiation declaration to suppress this warning if 'MPI_Type<long>::type' is
      explicitly instantiated in another translation unit
    MPI_Type< T >::type,
                   ^
1 warning generated.
[ 48%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/synaptic_element.cpp.o
[ 48%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/growth_curve.cpp.o
[ 49%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/kernel_manager.cpp.o
[ 49%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/vp_manager.cpp.o
[ 50%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/io_manager.cpp.o
[ 50%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/mpi_manager.cpp.o
[ 50%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/simulation_manager.cpp.o
[ 51%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/connection_manager.cpp.o
In file included from /Users/ehagen/Repositories/nest-simulator/nestkernel/connection_manager.cpp:49:
/Users/ehagen/Repositories/nest-simulator/nestkernel/mpi_manager_impl.h:95:20: warning: instantiation of variable 'MPI_Type<long>::type' required here, but no definition is available
      [-Wundefined-var-template]
    MPI_Type< T >::type,
                   ^
/Users/ehagen/Repositories/nest-simulator/nestkernel/mpi_manager_impl.h:139:7: note: in instantiation of function template specialization
      'nest::MPIManager::communicate_Allgatherv<long>' requested here
      communicate_Allgatherv< long >(
      ^
/Users/ehagen/Repositories/nest-simulator/nestkernel/connection_manager.cpp:873:26: note: in instantiation of function template specialization
      'nest::MPIManager::communicate<nest::LocalNodeListBase<nest::LocalLeafListIterator> >' requested here
    kernel().mpi_manager.communicate( local_sources, global_sources );
                         ^
/Users/ehagen/Repositories/nest-simulator/nestkernel/mpi_manager_impl.h:82:23: note: forward declaration of template entity is here
  static MPI_Datatype type;
                      ^
/Users/ehagen/Repositories/nest-simulator/nestkernel/mpi_manager_impl.h:95:20: note: add an explicit instantiation declaration to suppress this warning if 'MPI_Type<long>::type' is
      explicitly instantiated in another translation unit
    MPI_Type< T >::type,
                   ^
1 warning generated.
[ 51%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/sp_manager.cpp.o
[ 52%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/delay_checker.cpp.o
[ 52%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/rng_manager.cpp.o
[ 52%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/event_delivery_manager.cpp.o
[ 53%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/node_manager.cpp.o
[ 53%] Building CXX object nestkernel/CMakeFiles/nestkernel.dir/logging_manager.cpp.o
[ 54%] Linking CXX shared library libnestkernel.dylib
[ 54%] Built target nestkernel
[ 55%] Building CXX object models/CMakeFiles/models.dir/ac_generator.cpp.o
[ 55%] Building CXX object models/CMakeFiles/models.dir/aeif_cond_alpha.cpp.o
[ 56%] Building CXX object models/CMakeFiles/models.dir/aeif_cond_alpha_RK5.cpp.o
[ 56%] Building CXX object models/CMakeFiles/models.dir/aeif_cond_alpha_multisynapse.cpp.o
In file included from /Users/ehagen/Repositories/nest-simulator/models/aeif_cond_alpha_multisynapse.cpp:23:
In file included from /Users/ehagen/Repositories/nest-simulator/models/aeif_cond_alpha_multisynapse.h:38:
In file included from /Users/ehagen/Repositories/nest-simulator/nestkernel/archiving_node.h:41:
In file included from /Users/ehagen/Repositories/nest-simulator/nestkernel/node.h:35:
In file included from /Users/ehagen/Repositories/nest-simulator/nestkernel/event.h:36:
In file included from /Users/ehagen/Repositories/nest-simulator/nestkernel/exceptions.h:30:
In file included from /Users/ehagen/Repositories/nest-simulator/sli/name.h:30:
/Users/ehagen/anaconda3/include/c++/v1/map:629:15: error: object of type 'std::__1::pair<Name, const nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse> >' cannot be assigned
      because its copy assignment operator is implicitly deleted
        {__nc = __v.__cc; return *this;}
              ^
/Users/ehagen/anaconda3/include/c++/v1/__tree:1645:35: note: in instantiation of member function 'std::__1::__value_type<Name, const
      nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse> >::operator=' requested here
                __cache->__value_ = *__first;
                                  ^
/Users/ehagen/anaconda3/include/c++/v1/__tree:1575:9: note: in instantiation of function template specialization 'std::__1::__tree<std::__1::__value_type<Name, const
      nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse> >, std::__1::__map_value_compare<Name, std::__1::__value_type<Name, const
      nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse> >, std::__1::less<Name>, true>, std::__1::allocator<std::__1::__value_type<Name, const
      nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse> > > >::__assign_multi<std::__1::__tree_const_iterator<std::__1::__value_type<Name, const
      nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse> >, std::__1::__tree_node<std::__1::__value_type<Name, const nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse>
      >, void *> *, long> >' requested here
        __assign_multi(__t.begin(), __t.end());
        ^
/Users/ehagen/anaconda3/include/c++/v1/map:912:21: note: in instantiation of member function 'std::__1::__tree<std::__1::__value_type<Name, const
      nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse> >, std::__1::__map_value_compare<Name, std::__1::__value_type<Name, const
      nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse> >, std::__1::less<Name>, true>, std::__1::allocator<std::__1::__value_type<Name, const
      nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse> > > >::operator=' requested here
            __tree_ = __m.__tree_;
                    ^
/Users/ehagen/Repositories/nest-simulator/nestkernel/recordables_map.h:183:7: note: in instantiation of member function 'std::__1::map<Name, const
      nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse>, std::__1::less<Name>, std::__1::allocator<std::__1::pair<const Name, const
      nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse> > > >::operator=' requested here
class DynamicRecordablesMap
      ^
/Users/ehagen/anaconda3/include/c++/v1/utility:325:5: note: copy assignment operator is implicitly deleted because 'pair<Name, const
      nest::DataAccessFunctor<nest::aeif_cond_alpha_multisynapse> >' has a user-declared move constructor
    pair(pair&&) = default;
    ^
1 error generated.
make[2]: *** [models/CMakeFiles/models.dir/aeif_cond_alpha_multisynapse.cpp.o] Error 1
make[1]: *** [models/CMakeFiles/models.dir/all] Error 2
make: *** [all] Error 2

@heplesser
Copy link
Contributor Author

@espenhgn These are problems with newer C++ versions and here presumably libc++ instead of libstdc++. We need to modernize NEST code, see #974. There are a few more problems of this kind. As a work-around, you can try to use an older version of clang or use gcc.

@heplesser heplesser requested a review from jougs June 27, 2018 11:24
Copy link
Contributor

@jougs jougs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I very much like this simplification of the code and only have a small comment on the structure.

"t < %1s required.", std::numeric_limits< int >::max() ) );
}
else if ( t > 0 )
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this cascade of checks would be nicer and more readable if there were

  • stand-alone ifs for the checks, which throw in case of a parameter error (i.e. no else ifs)
  • no else if block at the end, but the code from that just behind the checks, thus rather having simpler code than treating the case of t == 0 differently from t > 0. The overhead is probably negligible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jougs Thank you for your feedback! I have now tidied the code as you suggested.


// on some systems, select may modify tv, therefore, it cannot be const
struct timeval tv = { t_sec, t_musec };
select( 0, 0, 0, 0, &tv );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, I find it a bit weird to use select here instead of just

#include <unistd.h>
...
usleep(microseconds);

Can you please change (or at least comment on) this? Thanks!

@heplesser
Copy link
Contributor Author

@jougs I now replaced select() with sleep() and usleep(). These sleep only the current thread, but since the SLI interpreter is single-threaded, this should not be any problem. I actually do not quite understand why we have sleep in SLI at all ...

Copy link
Contributor

@jougs jougs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is the best we can do for this function. Many thanks :-)

@jougs jougs merged commit 475f026 into nest:master Jul 3, 2018
@heplesser heplesser deleted the fix-973-sleep-function branch July 4, 2018 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: High Should be handled next T: Maintenance Work to keep up the quality of the code and documentation. ZC: Interpreter DO NOT USE THIS LABEL ZP: PR Created DO NOT USE THIS LABEL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SLI sleep implementation conforming to standards?
4 participants