Icon Créer jeu Créer jeu

Sistemas Operativos Semana 4 Act 2

Compléter

Estructura de Datos Semana 1

Téléchargez la version pour jouer sur papier

0 fois fait

Créé par

Colombia
Ce jeu est une version de

Top 10 résultats

Il n'y a toujours pas de résultats pour ce jeu. Soyez le premier à apparaître dans le classement! pour vous identifier.
Créez votre propre jeu gratuite à partir de notre créateur de jeu
Affrontez vos amis pour voir qui obtient le meilleur score dans ce jeu

Top Jeux

  1. temps
    but
  1. temps
    but
temps
but
temps
but
 
game-icon

Compléter

Sistemas Operativos Semana 4 Act 2Version en ligne

Estructura de Datos Semana 1

par Anyelo Gerley Quintero Reyes
1

join start sleep hilo2 tarea

import threading
import time
#funcion que simula una tarea en un hilo
def ( nombre , duracion ) :
print ( f " El hilo { nombre } ha comenzado " )
time . ( duracion )
print ( f " El hilo { nombre } ha terminado " )
# Crear dos hilos que se ejecutarán en paralelo
hilo1 = threading . Thread ( target = tarea , args = ( " Hilo 1 " , 2 ) ) # Toma 2 segundos
hilo2 = threading . Thread ( target = tarea , args = ( " Hilo 2 " , 4 ) ) # Toma 2 segundos

# Iniciar los hilos
hilo1 . ( )
. start ( )

# Esperar a que ambos hilos terminen
hilo1 . ( )
hilo2 . join ( )

print ( " Todos los hilos han terminado . " )

educaplay suscripción