[AG-TECH] Doubt with wx.CallAfter

carlosperezs at alumnos.uvigo.es carlosperezs at alumnos.uvigo.es
Mon May 22 03:11:28 CDT 2006



Hello together::

I have programmed this fuction:

def OnNewMovie(self, event):
        """ Local user receives a new movie event from a user"""

        #self.log.debug( "Got OnNewMovie, " + `event`)
        if event.data[0] == self.pubId:
            fDep.write("New movie equal\n")
            fDep.flush()
            #self.log.debug( "Returning, it's my movie")
            # This lets two users connect at the same time
            self.lockInitSession.acquire()
            if self.vInitSession == False:
               self.vInitSession = True
               self.lockInitSession.release()
            else:
               self.lockInitSession.release()
            
            return
          

        #self.log.debug( "Doing remote load event id = " + `event.data[0]` + ",
myid=" + `self.pubId`)
        self.lockInitSession.acquire()                
        self.vInitSession = False
        self.lockInitSession.release()
                  
        self.sharedAppClient.UpdateDataCache()
        self.GetState()
        wx.CallAfter(self.sm.RemoteLoadMovie)

This function is a handler that is executed when a event occurs. At the end is
wx.CallAfter call.  
Imagine that two events occur simultaneously. This function takes one  event.
After executing ax.CallAfter call would take the second event. Then , my doubt
would be, would be there 2 threads simultanously executing: one belongs to
self.sm.RemoteLoadMovie and the another one belongs to the handler for the
second event?

Thank you. As you can see i do not know exactly how wx.CallAfter works.

--oOo-----------------------------------------------------------------oOo--

Servicio de acceso ó correo electrónico vía web da Universidade de Vigo
Servicio de acceso al correo electrónico vía web de la Universidad de Vigo

Servicios Informáticos [ http://si.uvigo.es ]
Universidade de Vigo [ http://www.uvigo.es ]

URL: https://correoweb.uvigo.es




More information about the ag-tech mailing list