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

 

 


Tema destacado: Introducción a Git (Primera Parte)


  Mostrar Mensajes
Páginas: [1] 2 3 4
1  Programación / Programación C/C++ / Re: [C++] Me dan su opinion sobre esto? en: 6 Diciembre 2012, 22:17 pm
xdd! eso es programacion en C. jejjeje y la API de windows es dificil de usar. Son de muy bajo nivel para mi gusto.

No veo nada de c++...

Ademas las librerias de c++ puedes usar otras que son muy faciles, claro que debes bajarlas y compilarlas del cod fuente.

Yo te recomiendo C++ y no C. jajaja C es dificil.
2  Programación / Programación General / Re: haskell en: 4 Diciembre 2012, 22:43 pm
jejejeje sip lo escribi asi nomas, lo pase del libro. Gracias igual! Animo a todos al mundo haskell!
3  Programación / Programación General / Re: haskell en: 4 Diciembre 2012, 22:24 pm
xdd! es que no entiendo el operador de binding de la monada de estado...
Código
  1. Instance Monad (State s)
  2. (>>=) :: State s a -> (a -> State a b) -> State a b
  3. oroccessor >>= processorGenerator = State $ ->
  4.                                     let (x,st') = runState processor st
  5.                                     in runState (processorGenerator x) st'

Lo que no capto es la verdadera utilidad de esto... que se yo como por ejemplo la monada Maybe es muy sencilla, o la IO, aunque no vi la implementacion se entiende.

Me frustre para entender este del estado. (no escribi el return por que ese si lo capte)
4  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!
5  Programación / Programación C/C++ / Re: Ayuda porfavorsito con programa en c++ en: 4 Diciembre 2012, 21:44 pm
waaaa que feo codigo, por favor, que feo codigo.... horrible.... waaa terrible en todos los sentidos...

STotLib = 0;
   for(i=0;i<8;i=i+1)
   { STotLib = STotLib + CantLibros; }

ahi ta el problema
CantLibros es UN PUNTERO (: y sumas a STotLib 8 veces el puntero.
6  Programación / Programación C/C++ / Re: ejercicio de vectores en: 4 Diciembre 2012, 21:22 pm
hola! Al parecer esta bien tu f60, por que recorrera todo el vector, este ordenado o no. Tu f60 es la version no ordenada. Y en la ordenada. cambias el argumento del while, para comprobar si te pasaste o no.
7  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!
8  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.
9  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.
10  Programación / Programación C/C++ / Re: Duda con funcion<...> en: 25 Enero 2012, 17:22 pm
No me referia al casting, lo di solo como un ejemplo. Lo que me interesaria saber es como implementar funciones con esos <>.

Gracias satu (:
Páginas: [1] 2 3 4
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines