elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


  Mostrar Temas
Páginas: [1] 2
1  Programación / Programación General / haskell en: 4 Diciembre 2012, 21:50 pm
Hola gente! Alguien estudiando haskell? Si lo estan mandemen un mp para intercambiar conocimientos! Saludos!
2  Programación / Programación C/C++ / std::thread problema en: 16 Mayo 2012, 14:13 pm
Hola gente tengo un pequeño probrlma con el std::thread, este es mi siguiente codigo

Código
  1.    #include <iostream>
  2.    #include <thread>
  3.  
  4.    using namespace std;
  5.  
  6.    class FOO
  7.    {
  8.    public:
  9.     void do_something ()
  10.     {
  11.     cout<<"cout somethin\n";
  12.     }
  13.    };
  14.  
  15.    int main ()
  16.    {
  17.     FOO foo;
  18.     std::thread t (&FOO::do_something,&foo);
  19.     t.join();
  20.    }

Cuando hago un

Código
  1.    valgrind --tool=drd ./oncordia

donde oncordia se llama mi ejecutable. Ejecuto varias veces ese comando hasta que en una oportunidad obtengo:
:
Código
  1.    ==6218== drd, a thread error detector
  2.    ==6218== Copyright (C) 2006-2010, and GNU GPL'd, by Bart Van Assche.
  3.    ==6218== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
  4.    ==6218== Command: ./oncordia
  5.    ==6218==
  6.    cout somethin
  7.    ==6218== Conflicting store by thread 1 at 0x05b5d050 size 8
  8.    ==6218==    at 0x418E62: std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >::~_Impl() (in /home/ezequiel/projects/oncordia/build/oncordia)
  9.    ==6218==    by 0x419099: std::_Sp_destroy_inplace<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >::operator()(std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >*) const (in /home/ezequiel/projects/oncordia/build/oncordia)
  10.    ==6218==    by 0x418EDC: std::_Sp_counted_deleter<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >*, std::_Sp_destroy_inplace<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (shared_ptr_base.h:351)
  11.    ==6218==    by 0x4180B7: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (shared_ptr_base.h:146)
  12.    ==6218==    by 0x417F62: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (shared_ptr_base.h:551)
  13.    ==6218==    by 0x417E99: std::__shared_ptr<std::thread::_Impl_base, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (shared_ptr_base.h:751)
  14.    ==6218==    by 0x417EB3: std::shared_ptr<std::thread::_Impl_base>::~shared_ptr() (shared_ptr.h:93)
  15.    ==6218==    by 0x418037: std::thread::thread<void (FOO::*)(), FOO*>(void (FOO::*&&)(), FOO*&&) (thread:135)
  16.    ==6218==    by 0x417CCB: main (main.cpp:18)
  17.    ==6218== Address 0x5b5d050 is at offset 32 from 0x5b5d030. Allocation context:
  18.    ==6218==    at 0x4C2AAB7: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
  19.    ==6218==    by 0x418A5F: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) (new_allocator.h:92)
  20.    ==6218==    by 0x418846: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Sp_make_shared_tag, std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >*, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr_base.h:517)
  21.    ==6218==    by 0x418775: std::__shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Sp_make_shared_tag, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr_base.h:986)
  22.    ==6218==    by 0x4186C1: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >::shared_ptr<std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Sp_make_shared_tag, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr.h:313)
  23.    ==6218==    by 0x4185A3: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > std::allocate_shared<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr.h:531)
  24.    ==6218==    by 0x418360: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > std::make_shared<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr.h:547)
  25.    ==6218==    by 0x4181BF: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > std::thread::_M_make_routine<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (thread:194)
  26.    ==6218==    by 0x418005: std::thread::thread<void (FOO::*)(), FOO*>(void (FOO::*&&)(), FOO*&&) (thread:135)
  27.    ==6218==    by 0x417CCB: main (main.cpp:18)
  28.    ==6218== Other segment start (thread 2)
  29.    ==6218==    (thread finished, call stack no longer available)
  30.    ==6218== Other segment end (thread 2)
  31.    ==6218==    (thread finished, call stack no longer available)
  32.    ==6218==
  33.    ==6218== Conflicting store by thread 1 at 0x05b5d050 size 8
  34.    ==6218==    at 0x417EC6: std::thread::_Impl_base::~_Impl_base() (in /home/ezequiel/projects/oncordia/build/oncordia)
  35.    ==6218==    by 0x418E74: std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >::~_Impl() (in /home/ezequiel/projects/oncordia/build/oncordia)
  36.    ==6218==    by 0x419099: std::_Sp_destroy_inplace<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >::operator()(std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >*) const (in /home/ezequiel/projects/oncordia/build/oncordia)
  37.    ==6218==    by 0x418EDC: std::_Sp_counted_deleter<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >*, std::_Sp_destroy_inplace<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (shared_ptr_base.h:351)
  38.    ==6218==    by 0x4180B7: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (shared_ptr_base.h:146)
  39.    ==6218==    by 0x417F62: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (shared_ptr_base.h:551)
  40.    ==6218==    by 0x417E99: std::__shared_ptr<std::thread::_Impl_base, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (shared_ptr_base.h:751)
  41.    ==6218==    by 0x417EB3: std::shared_ptr<std::thread::_Impl_base>::~shared_ptr() (shared_ptr.h:93)
  42.    ==6218==    by 0x418037: std::thread::thread<void (FOO::*)(), FOO*>(void (FOO::*&&)(), FOO*&&) (thread:135)
  43.    ==6218==    by 0x417CCB: main (main.cpp:18)
  44.    ==6218== Address 0x5b5d050 is at offset 32 from 0x5b5d030. Allocation context:
  45.    ==6218==    at 0x4C2AAB7: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
  46.    ==6218==    by 0x418A5F: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) (new_allocator.h:92)
  47.    ==6218==    by 0x418846: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Sp_make_shared_tag, std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >*, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr_base.h:517)
  48.    ==6218==    by 0x418775: std::__shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Sp_make_shared_tag, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr_base.h:986)
  49.    ==6218==    by 0x4186C1: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >::shared_ptr<std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Sp_make_shared_tag, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr.h:313)
  50.    ==6218==    by 0x4185A3: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > std::allocate_shared<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr.h:531)
  51.    ==6218==    by 0x418360: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > std::make_shared<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr.h:547)
  52.    ==6218==    by 0x4181BF: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > std::thread::_M_make_routine<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (thread:194)
  53.    ==6218==    by 0x418005: std::thread::thread<void (FOO::*)(), FOO*>(void (FOO::*&&)(), FOO*&&) (thread:135)
  54.    ==6218==    by 0x417CCB: main (main.cpp:18)
  55.    ==6218== Other segment start (thread 2)
  56.    ==6218==    (thread finished, call stack no longer available)
  57.    ==6218== Other segment end (thread 2)
  58.    ==6218==    (thread finished, call stack no longer available)
  59.    ==6218==
  60.    ==6218== Conflicting load by thread 1 at 0x05b5d060 size 8
  61.    ==6218==    at 0x417F4C: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (shared_ptr_base.h:550)
  62.    ==6218==    by 0x417E99: std::__shared_ptr<std::thread::_Impl_base, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (shared_ptr_base.h:751)
  63.    ==6218==    by 0x417EB3: std::shared_ptr<std::thread::_Impl_base>::~shared_ptr() (shared_ptr.h:93)
  64.    ==6218==    by 0x417EDC: std::thread::_Impl_base::~_Impl_base() (in /home/ezequiel/projects/oncordia/build/oncordia)
  65.    ==6218==    by 0x418E74: std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >::~_Impl() (in /home/ezequiel/projects/oncordia/build/oncordia)
  66.    ==6218==    by 0x419099: std::_Sp_destroy_inplace<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >::operator()(std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >*) const (in /home/ezequiel/projects/oncordia/build/oncordia)
  67.    ==6218==    by 0x418EDC: std::_Sp_counted_deleter<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >*, std::_Sp_destroy_inplace<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (shared_ptr_base.h:351)
  68.    ==6218==    by 0x4180B7: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (shared_ptr_base.h:146)
  69.    ==6218==    by 0x417F62: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (shared_ptr_base.h:551)
  70.    ==6218==    by 0x417E99: std::__shared_ptr<std::thread::_Impl_base, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (shared_ptr_base.h:751)
  71.    ==6218==    by 0x417EB3: std::shared_ptr<std::thread::_Impl_base>::~shared_ptr() (shared_ptr.h:93)
  72.    ==6218==    by 0x418037: std::thread::thread<void (FOO::*)(), FOO*>(void (FOO::*&&)(), FOO*&&) (thread:135)
  73.    ==6218== Address 0x5b5d060 is at offset 48 from 0x5b5d030. Allocation context:
  74.    ==6218==    at 0x4C2AAB7: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
  75.    ==6218==    by 0x418A5F: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) (new_allocator.h:92)
  76.    ==6218==    by 0x418846: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Sp_make_shared_tag, std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >*, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr_base.h:517)
  77.    ==6218==    by 0x418775: std::__shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Sp_make_shared_tag, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr_base.h:986)
  78.    ==6218==    by 0x4186C1: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >::shared_ptr<std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Sp_make_shared_tag, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr.h:313)
  79.    ==6218==    by 0x4185A3: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > std::allocate_shared<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::allocator<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > const&, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr.h:531)
  80.    ==6218==    by 0x418360: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > std::make_shared<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >, std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (shared_ptr.h:547)
  81.    ==6218==    by 0x4181BF: std::shared_ptr<std::thread::_Impl<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> > > std::thread::_M_make_routine<std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)> >(std::_Bind_result<void, std::_Mem_fn<void (FOO::*)()> ()(FOO*)>&&) (thread:194)
  82.    ==6218==    by 0x418005: std::thread::thread<void (FOO::*)(), FOO*>(void (FOO::*&&)(), FOO*&&) (thread:135)
  83.    ==6218==    by 0x417CCB: main (main.cpp:18)
  84.    ==6218== Other segment start (thread 2)
  85.    ==6218==    (thread finished, call stack no longer available)
  86.    ==6218== Other segment end (thread 2)
  87.    ==6218==    (thread finished, call stack no longer available)
  88.    ==6218==
  89.    ==6218==
  90.    ==6218== For counts of detected and suppressed errors, rerun with: -v


gracias!
3  Programación / Programación C/C++ / Multi Hilo en: 15 Marzo 2012, 13:53 pm
Hola, lo que estoy buscando es un consejo. Estoy desarrollando un pequeño sistema de renderizado en tiempo real con opengl, solo como hobby, aun esta en pañales no es para nada solido, pero funciona.

El tema es el siguiente, quiero que mi aplicacion sea multihilo y orientada a objetos. El problema recide en que no se nada de multihilos.

Y la pregunta es, a que puedo ir desarrollando el sistema en forma comun, y luego una vez que aprendi esto de multihilos aplicarlo?

Si se puede a que limitaciones me debo atener?

Gracias.
4  Programación / Programación C/C++ / Notaciones en: 6 Febrero 2012, 14:31 pm
Hola gente.........!

Queria saber cual es la notacion correcta, cuando programo C++ POO.
Leyendo unos codigos que a mi entender son de Produccion, no entiendo los prefijos.
Esta bien lo siguiente?:

En una clase abstracta ya sea en su declaracion como definicion si correspode, el prefijo seria Una letra que correspoda al nombre del projecto, o muy pocas letras que lo identifiquen

Las estructuras. Siempre van en las cabezeras, y se el prefijo es S.
E con enum
C con las classes

Pero en ocasiones varia esto, por ejemplo mi proyecto se llama Telefono

TMarcar ---->clase abstracta marcar del projecto Telfono, pero tambien typedefs???
TellMarcar ----> clase abstracta telefono

Pero en algunos casos ambos se mezclan.

Alguien me podria pasar alguno de sus magicos links clarificadores, para este tema, Gracias.
5  Programación / Programación C/C++ / Duda con funcion<...> en: 25 Enero 2012, 15:52 pm
Hola!! Tengo una inquietud, o mas bien no se como funciona eso de funcion<>, osea cuando entre <> va el tipo de dato. Agradeceria que me dieran el nombre de este tipo "cosa", asi puedo buscar en g00gl3.

Al estilo static_cast<void (*)(double)>(&miFuncion); Pero me gustaria saber como funciona ese <> para implementarlo y saber sus aplicaciones, desde ya agradezco el nombre y un link si no es molestia. (: (:

Gracias.
6  Programación / Programación C/C++ / problema con CONST en: 8 Enero 2012, 16:55 pm
Hola gente, tengo un problemita que no llego a desentrañar, como puede ser que este codigo no tire error??

Código
  1. const OIS::MouseState &ms=mMouse->getMouseState(); //Retrona un const OIS::MuseState &
  2. ms.width=width;
  3. ms.height=height;

Compila!! Ni warrings. Pero lo trato hacer yo a parte con mis propias clases y si me da error.
En teoria no puedo modificar nada constante,

Como es esto? xd
7  Programación / Programación C/C++ / Vector en tres dimensiones en: 27 Diciembre 2011, 20:17 pm
Hola gente. Estoy hace dos dias intentando y realmente no se que me pasa pero no puedo hacerlo.

Quiero hacer girar un vector al rededor del centro de coordenadas, con un determinado radio. En dos dimensiones me basta.

Lo que obtube en estos dos dias es que: con la funcion ceno, no puedo hacer un circulo, asique gaste tiempo al dope, lo que si sirve es que:

vector.y=sqrt(pow(radio,2)-pow(vector.x,2));

pero pincho cuando y==0, se me queda trabado ahi y no se me mueve el vector, si alguien me ayuda con este problema se lo agradeceria mucho.
8  Programación / Programación C/C++ / Enum y operadores (noob) en: 20 Diciembre 2011, 18:40 pm
Hola, casi feliz navidad... (?)

digamos que tengo lo siguiente:

enum {
    id1=0,
    id2=1 << 0,
    id3=1 << 1
};

No caso que quiere decir los <<. Desde ya muchas gracias.
9  Programación / Programación C/C++ / ver argumentos de funciones codeblocks en: 15 Diciembre 2011, 21:24 pm
Hola gente, es basicamente esa mi pregunta. Como hago para ver los argumentos que tiene una funcion sin tener que ir al dodigo fuente, al tipico estilo netBeans pero en codeblocks. Me he fijado en las opciones de autocompletado pero nada...

No uso netBeans por que tiene bugs al trabajar con c++. Por ello pero alli me funciona esa ayudita de los argumentos.

desde ya gracias.
10  Sistemas Operativos / GNU/Linux / Enviar pulsos por usb linux en: 13 Octubre 2011, 16:09 pm
Hola gente. Me podrian pasar info, de donde puedo encontrar algun ejemplito simple. De como detectar conexionado a puerto usb, Y manipular las entradas y salidas del puerto. (en español xd) Osea necesito:

*Obtener donde se conecto el dipositivo. Este dispositivo solo avisa su conexionado por una resistencia de conexion.

*Envio por dos de los puertos del usb, la informacion. Controlando yo manualmente la frecuencia y demas. Solo ncesito saber como enviar 0, y 1,

Pido mucho. "Programo" en assembler de pic, y en C. Desde ya gracias.

pd.: uso Ubuntu 10.04 LTS 64bits.
Páginas: [1] 2
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines