>
> Aqui tienes un problema:
>
> Cuando realices:
>
>    obj_C3_1 = C3()
>    obj_C3_1.start()
>
> se crearan las instancias iniciales de las clases H1..Hn (singletons)
>
> Cuando a continuación realices:
>
>    obj_C3_j = C3()
>    obj_C3_j.start()
>
> En metodo run() intentrá crear nuevas instancias de H1..Hn, pero como son
> singletons utilizará las mismas que ya creastes y activastes en obj_C3_1 y
> dará error.
>



Creo que eso lo puedo arreglar sobreescribiendo el metodo start(). Algo
como...



class C2(threading.Thread):
        def __init__(self):
                threading.Thread.__init__(self)
                self.__started = False

        def start(self):
                if not self.__started:
                        threading.Thread.start(self)
                self.__started = True
_______________________________________________
Python-es mailing list
Python-es@python.org
http://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/

Responder a