diff --git a/TRANSLATORS b/TRANSLATORS index ec4c6a8741..9f6199709f 100644 --- a/TRANSLATORS +++ b/TRANSLATORS @@ -1,3 +1,4 @@ +Gabriel Anguita (@gabrielanguita) Paula Aragón (@pandrearro) Emmanuel Arias (@eamanu) Paula Aragón (@pandrearro diff --git a/dict b/dict index 7bbcac0ec3..5ec0541331 100644 --- a/dict +++ b/dict @@ -277,6 +277,7 @@ datagramas debugueando darwin debugueando +darwin default desasignar deserialización @@ -518,6 +519,7 @@ pads parsea parseada parsear +perfilador pax pasándole path @@ -727,6 +729,8 @@ vía versionados Win vía +versionados +Win von wchar web @@ -785,6 +789,23 @@ Weibull pseudoaleatorios reproducibles Reproducibilidad +reproducible +retrocompatible +remuestreo +Modeling +ésimo +manejarla +resucitarlo +KiB +bloqueantes +reentrante +reentrantes +rastrearlo +readquirido +readquirir +Edsger +W +Dijkstra keyword offset setuptools @@ -823,4 +844,4 @@ post autocompletado inf especificam -parser +parser \ No newline at end of file diff --git a/library/threading.po b/library/threading.po index 0bf52f0c74..2cec2a7995 100644 --- a/library/threading.po +++ b/library/threading.po @@ -6,37 +6,41 @@ # Check https://github.com/PyCampES/python-docs-es/blob/3.8/TRANSLATORS to # get the list of volunteers # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-05 12:54+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2020-07-03 21:06-0400\n" "Language-Team: python-doc-es\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.8.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Last-Translator: \n" +"Language: es_419\n" +"X-Generator: Poedit 2.3.1\n" #: ../Doc/library/threading.rst:2 msgid ":mod:`threading` --- Thread-based parallelism" -msgstr "" +msgstr ":mod:`threading` --- Paralelismo basado en hilos" #: ../Doc/library/threading.rst:7 msgid "**Source code:** :source:`Lib/threading.py`" -msgstr "" +msgstr "**Código fuente:** :source:`Lib/threading.py`" #: ../Doc/library/threading.rst:11 msgid "" "This module constructs higher-level threading interfaces on top of the lower " "level :mod:`_thread` module. See also the :mod:`queue` module." msgstr "" +"Este módulo construye interfaces de hilado de alto nivel sobre el módulo de " +"más bajo nivel :mod:`_thread`. Ver también el módulo :mod:`queue`." #: ../Doc/library/threading.rst:14 msgid "This module used to be optional, it is now always available." -msgstr "" +msgstr "Este módulo solía ser opcional, ahora está siempre disponible." #: ../Doc/library/threading.rst:19 msgid "" @@ -44,16 +48,21 @@ msgid "" "methods and functions in this module in the Python 2.x series are still " "supported by this module." msgstr "" +"Aunque no están listados en lo que sigue, los nombres en ``camelCase`` " +"usados para algunos de los métodos y funciones de la versión Python 2.x " +"todavía son soportados por este módulo." #: ../Doc/library/threading.rst:24 msgid "This module defines the following functions:" -msgstr "" +msgstr "Este módulo define las siguientes funciones:" #: ../Doc/library/threading.rst:29 msgid "" "Return the number of :class:`Thread` objects currently alive. The returned " "count is equal to the length of the list returned by :func:`.enumerate`." msgstr "" +"Retorna el número de objetos :class:`Thread` actualmente con vida. La cuenta " +"retornada es igual al largo de la lista retornada por :func:`.enumerate`." #: ../Doc/library/threading.rst:35 msgid "" @@ -62,48 +71,58 @@ msgid "" "through the :mod:`threading` module, a dummy thread object with limited " "functionality is returned." msgstr "" +"Retorna el objeto :class:`Thread` actual, correspondiente al hilo de control " +"del invocador. Si el hilo de control del invocador no fue creado a través " +"del módulo :mod:`threading`, se retorna un objeto hilo *dummy* con " +"funcionalidad limitada." #: ../Doc/library/threading.rst:43 msgid "Handle uncaught exception raised by :func:`Thread.run`." -msgstr "" +msgstr "Gestiona una excepción lanzada por :func:`Thread.run`." #: ../Doc/library/threading.rst:45 msgid "The *args* argument has the following attributes:" -msgstr "" +msgstr "El argumento *args* posee los siguientes atributos:" #: ../Doc/library/threading.rst:47 msgid "*exc_type*: Exception type." -msgstr "" +msgstr "*exc_type*: Tipo de la excepción." #: ../Doc/library/threading.rst:48 msgid "*exc_value*: Exception value, can be ``None``." -msgstr "" +msgstr "*exc_value*: Valor de la excepción, puede ser ``None``." #: ../Doc/library/threading.rst:49 msgid "*exc_traceback*: Exception traceback, can be ``None``." -msgstr "" +msgstr "*exc_traceback*: Rastreo de la excepción, puede ser ``None``." #: ../Doc/library/threading.rst:50 msgid "*thread*: Thread which raised the exception, can be ``None``." -msgstr "" +msgstr "*thread*: El hilo que ha lanzado la excepción, puede ser ``None``." #: ../Doc/library/threading.rst:52 msgid "" "If *exc_type* is :exc:`SystemExit`, the exception is silently ignored. " "Otherwise, the exception is printed out on :data:`sys.stderr`." msgstr "" +"Si *exc_type* es :exc:`SystemExit`, la excepción es silenciosamente " +"ignorada. De otro modo, la excepción se imprime en :data:`sys.stderr`." #: ../Doc/library/threading.rst:55 msgid "" "If this function raises an exception, :func:`sys.excepthook` is called to " "handle it." msgstr "" +"Si esta función lanza una excepción, se llama a :func:`sys.excepthook` para " +"manejarla." #: ../Doc/library/threading.rst:58 msgid "" ":func:`threading.excepthook` can be overridden to control how uncaught " "exceptions raised by :func:`Thread.run` are handled." msgstr "" +":func:`threading.excepthook` se puede sobrescribir para controlar cómo se " +"gestionan las excepciones levantadas por :func:`Thread.run`." #: ../Doc/library/threading.rst:61 msgid "" @@ -111,6 +130,9 @@ msgid "" "should be cleared explicitly to break the reference cycle when the exception " "is no longer needed." msgstr "" +"Guarda *exc_value* usando un *hook* personalizado puede crear un ciclo de " +"referencias. Debe ser aclarado explícitamente que se rompa el ciclo de " +"referencias cuando la excepción ya no se necesite." #: ../Doc/library/threading.rst:65 msgid "" @@ -118,10 +140,14 @@ msgid "" "object which is being finalized. Avoid storing *thread* after the custom " "hook completes to avoid resurrecting objects." msgstr "" +"Guarda *thread* usando un *hook* personalizado puede resucitarlo si se " +"asigna a un objeto que esté siendo finalizado. Evítese que *thread* sea " +"almacenado después de que el *hook* personalizado se complete para evitar " +"resucitar objetos." #: ../Doc/library/threading.rst:70 msgid ":func:`sys.excepthook` handles uncaught exceptions." -msgstr "" +msgstr ":func:`sys.excepthook` gestiona excepciones no capturadas." #: ../Doc/library/threading.rst:77 msgid "" @@ -131,6 +157,11 @@ msgid "" "identifiers may be recycled when a thread exits and another thread is " "created." msgstr "" +"Retorna el 'identificador de hilo' del hilo actual. Éste es un entero " +"distinto de cero. Su valor no tiene un significado directo; ha sido pensado " +"como una *cookie* mágica para usarse, por ejemplo, en indexar un diccionario " +"con datos específicos del hilo. Los identificadores de hilo pueden ser " +"reciclados cuando se abandona un hilo y se crea otro hilo." #: ../Doc/library/threading.rst:88 msgid "" @@ -139,12 +170,19 @@ msgid "" "identify this particular thread system-wide (until the thread terminates, " "after which the value may be recycled by the OS)." msgstr "" +"Retorna la ID de Hilo (*Thread ID*) nativo integral del hilo actual asignado " +"por el *kernel*. Ella es un entero distinto de cero. Su valor puede " +"utilizarse para identificar de forma única a este hilo en particular a " +"través de todo el sistema (hasta que el hilo termine, luego de lo cual el " +"valor puede ser reciclado por el SO)." #: ../Doc/library/threading.rst:94 msgid "" ":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " "NetBSD, AIX." msgstr "" +":ref:`Disponibilidad `: Windows, FreeBSD, Linux, macOS, " +"OpenBSD, NetBSD, AIX." #: ../Doc/library/threading.rst:100 msgid "" @@ -153,12 +191,19 @@ msgid "" "`current_thread`, and the main thread. It excludes terminated threads and " "threads that have not yet been started." msgstr "" +"Retorna una lista de todos los objetos tipo :class:`Thread` actualmente con " +"vida. La lista incluye hilos demonio, objetos hilo *dummy* creados por :" +"func:`current_thread`, y el hilo principal. Excluye hilos terminados e hilos " +"que todavía no hayan sido iniciados." #: ../Doc/library/threading.rst:108 msgid "" "Return the main :class:`Thread` object. In normal conditions, the main " "thread is the thread from which the Python interpreter was started." msgstr "" +"Retorna el objeto :class:`Thread` principal. En condiciones normales, el " +"hilo principal es el hilo desde el que fue inicializado el intérprete de " +"Python." #: ../Doc/library/threading.rst:119 msgid "" @@ -166,6 +211,9 @@ msgid "" "module. The *func* will be passed to :func:`sys.settrace` for each thread, " "before its :meth:`~Thread.run` method is called." msgstr "" +"Establece una función de traza para todos los hilos iniciados desde el " +"módulo :mod:`threading` . La *func* se pasará a :func:`sys.settrace` por " +"cada hilo, antes de que su método :meth:`~Thread.run` sea llamado." #: ../Doc/library/threading.rst:128 msgid "" @@ -173,6 +221,9 @@ msgid "" "module. The *func* will be passed to :func:`sys.setprofile` for each " "thread, before its :meth:`~Thread.run` method is called." msgstr "" +"Establece una función de perfil para todos los hilos iniciados desde el " +"módulo :mod:`threading`. La *func* se pasará a :func:`sys.setprofile` por " +"cada hilo, antes de que se llame a su método :meth:`~Thread.run`." #: ../Doc/library/threading.rst:135 msgid "" @@ -192,15 +243,32 @@ msgid "" "stack size is the suggested approach in the absence of more specific " "information)." msgstr "" +"Retorna el tamaño de pila usado para crear nuevos hilos. El argumento " +"opcional *size* (tamaño) especifica el tamaño de pila a ser utilizado para " +"hilos creados posteriormente, y debe ser 0 (usar el valor por defecto de la " +"plataforma o el configurado) o un valor entero positivo de al menos 32.768 " +"(32KiB). Si no se especifica *size*, se usará 0. Si no existe soporte para " +"cambiar el tamaño de pila, se lanzará un :exc:`RuntimeError`. Si el tamaño " +"de pila especificado es inválido, se lanzará un :exc:`ValueError` y el " +"tamaño de pila no será modificado. El tamaño mínimo de pila actualmente " +"soportado es de 32KiB para garantizar suficiente espacio de pila para el " +"intérprete mismo. Nótese que algunas plataformas pueden tener restricciones " +"particulares de valores para tamaños de pila, como requerir un tamaño de " +"pila > 32KiB, o requerir una asignación en múltiplos del tamaño de página de " +"la memoria del sistema. Debe consultarse la documentación de cada plataforma " +"para mayor información (páginas de 4KiB son comunes; se recomienda el uso de " +"múltiplos de 4096 para el tamaño de pila en ausencia de información más " +"específica)" #: ../Doc/library/threading.rst:150 msgid "" ":ref:`Availability `: Windows, systems with POSIX threads." msgstr "" +":ref:`Disponibilidad `: Windows, sistemas con hilos POSIX." #: ../Doc/library/threading.rst:153 msgid "This module also defines the following constant:" -msgstr "" +msgstr "Este módulo también define la siguiente constante:" #: ../Doc/library/threading.rst:157 msgid "" @@ -209,12 +277,18 @@ msgid "" "Specifying a timeout greater than this value will raise an :exc:" "`OverflowError`." msgstr "" +"El máximo valor permitido para el parámetro *timeout* de las funciones " +"bloqueantes (:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:`Condition." +"wait`, etc.). La especificación de un tiempo de espera mayor a este valor " +"lanzará un :exc:`OverflowError`." #: ../Doc/library/threading.rst:165 msgid "" "This module defines a number of classes, which are detailed in the sections " "below." msgstr "" +"Este módulo define un número de clases, las cuales son detalladas en las " +"siguientes secciones." #: ../Doc/library/threading.rst:168 msgid "" @@ -226,14 +300,23 @@ msgid "" "stopped, suspended, resumed, or interrupted. The static methods of Java's " "Thread class, when implemented, are mapped to module-level functions." msgstr "" +"El diseño de este módulo está libremente basado en el modelo de *threading* " +"de Java. Sin embargo, donde Java hace de *locks* y variables condicionales " +"el comportamiento básico de cada objeto, éstos son objetos separados en " +"Python. La clase de Python :class:`Thread` soporta un subdominio del " +"comportamiento de la clase *Thread* de Java; actualmente, no hay " +"prioridades, ni grupos de hilos, y los hilos no pueden ser destruidos, " +"detenidos, suspendidos, retomados o interrumpidos. Los métodos estáticos de " +"la clase *Thread* de Java, cuando son implementados, son mapeados a " +"funciones a nivel de módulo." #: ../Doc/library/threading.rst:176 msgid "All of the methods described below are executed atomically." -msgstr "" +msgstr "Todos los métodos descritos abajo son ejecutados de manera atómica." #: ../Doc/library/threading.rst:180 msgid "Thread-Local Data" -msgstr "" +msgstr "Datos locales del hilo" #: ../Doc/library/threading.rst:182 msgid "" @@ -241,24 +324,30 @@ msgid "" "thread-local data, just create an instance of :class:`local` (or a subclass) " "and store attributes on it::" msgstr "" +"Los datos locales de hilo son datos cuyos valores son específicos a cada " +"hilo. Para manejar los datos locales de hilos, simplemente crear una " +"instancia de :class:`local` (o una subclase) y almacenar los atributos en " +"ella::" #: ../Doc/library/threading.rst:189 msgid "The instance's values will be different for separate threads." -msgstr "" +msgstr "Los valores de instancia serán diferentes para hilos distintos." #: ../Doc/library/threading.rst:194 msgid "A class that represents thread-local data." -msgstr "" +msgstr "Una clase que representa datos locales de hilo." #: ../Doc/library/threading.rst:196 msgid "" "For more details and extensive examples, see the documentation string of " "the :mod:`_threading_local` module." msgstr "" +"Para más detalles y ejemplos extensivos, véase la documentación del módulo :" +"mod:`_threading_local`." #: ../Doc/library/threading.rst:203 msgid "Thread Objects" -msgstr "" +msgstr "Objetos tipo hilo" #: ../Doc/library/threading.rst:205 msgid "" @@ -269,6 +358,13 @@ msgid "" "be overridden in a subclass. In other words, *only* override the :meth:" "`~Thread.__init__` and :meth:`~Thread.run` methods of this class." msgstr "" +"La clase :class:`Thread` representa una actividad que corre en un hilo de " +"control separado. Hay dos manera de especificar la actividad: pasando un " +"objeto invocable al constructor, o sobrescribiendo el método :meth:`~Thread." +"run` en una subclase. Ningún otro método (a excepción del constructor) " +"deberá ser sobrescrito en una subclase. En otras palabras, *solo* " +"sobrescribir los métodos :meth:`~Thread.__init__` y :meth:`~Thread.run` de " +"esta clase." #: ../Doc/library/threading.rst:212 msgid "" @@ -276,6 +372,9 @@ msgid "" "thread's :meth:`~Thread.start` method. This invokes the :meth:`~Thread.run` " "method in a separate thread of control." msgstr "" +"Una vez que un objeto *thread* es creado, su actividad debe ser iniciada " +"llamando al método :meth:`~Thread.start` del hilo. Ésto invoca el método :" +"meth:`~Thread.run` en un hilo de control separado." #: ../Doc/library/threading.rst:216 msgid "" @@ -284,6 +383,10 @@ msgid "" "normally, or by raising an unhandled exception. The :meth:`~Thread." "is_alive` method tests whether the thread is alive." msgstr "" +"Una vez que la actividad del hilo ha sido iniciada, el hilo se considerará " +"'vivo'. Deja de estar vivo cuando su método :meth:`~Thread.run` termina -- " +"ya sea normalmente, o por lanzar una excepción no manejada. El método :meth:" +"`~Thread.is_alive` verifica si acaso el hilo está vivo." #: ../Doc/library/threading.rst:221 msgid "" @@ -291,12 +394,17 @@ msgid "" "the calling thread until the thread whose :meth:`~Thread.join` method is " "called is terminated." msgstr "" +"Otros hilos pueden llamar al método :meth:`~Thread.join` de un hilo. Esto " +"bloquea el hilo llamador hasta que el hilo cuyo método :meth:`~Thread.join` " +"ha sido llamado termine." #: ../Doc/library/threading.rst:225 msgid "" "A thread has a name. The name can be passed to the constructor, and read or " "changed through the :attr:`~Thread.name` attribute." msgstr "" +"Un hilo tiene un nombre. El nombre puede ser pasado al constructor y leído o " +"cambiado a través del atributo :attr:`~Thread.name`." #: ../Doc/library/threading.rst:228 msgid "" @@ -304,6 +412,9 @@ msgid "" "excepthook` is called to handle it. By default, :func:`threading.excepthook` " "ignores silently :exc:`SystemExit`." msgstr "" +"Si el método :meth:`~Thread.run` lanza una excepción, se llama a :func:" +"`threading.excepthook` para gestionarla. Por defecto, :func:`threading." +"excepthook` ignora silenciosamente a :exc:`SystemExit`." #: ../Doc/library/threading.rst:232 msgid "" @@ -313,6 +424,11 @@ msgid "" "can be set through the :attr:`~Thread.daemon` property or the *daemon* " "constructor argument." msgstr "" +"Un hilo puede ser marcado como un \"hilo demonio\". El significado de esta " +"marca es que la totalidad del programa de Python finalizará cuando solo " +"queden hilos demonio. El valor inicial es heredado del hilo creador. La " +"marca puede ser establecida a través de la propiedad :attr:`~Thread.daemon` " +"o del argumento *daemon* en el constructor." #: ../Doc/library/threading.rst:239 msgid "" @@ -321,12 +437,19 @@ msgid "" "you want your threads to stop gracefully, make them non-daemonic and use a " "suitable signalling mechanism such as an :class:`Event`." msgstr "" +"Los hilos demonio son detenidos abruptamente al momento del cierre. Sus " +"recursos (tales como archivos abiertos, transacciones con bases de datos, " +"etc.) pueden no ser liberados adecuadamente. Si se requiere que los hilos se " +"detengan con gracia, háganse no-demoníacos y úsese un mecanismo de " +"señalización adecuado tal como un :class:`Event`." #: ../Doc/library/threading.rst:244 msgid "" "There is a \"main thread\" object; this corresponds to the initial thread of " "control in the Python program. It is not a daemon thread." msgstr "" +"Existe un objeto \"hilo principal\"; éste corresponde al hilo de control " +"inicial del programa de Python. No es un hilo demonio." #: ../Doc/library/threading.rst:247 msgid "" @@ -337,41 +460,60 @@ msgid "" "alive and daemonic, and cannot be :meth:`~Thread.join`\\ ed. They are never " "deleted, since it is impossible to detect the termination of alien threads." msgstr "" +"Existe la posibilidad de crear \"objetos de hilos *dummy*\". Estos son " +"objetos hilo correspondientes a \"hilos extranjeros\", que son hilos de " +"control iniciados afuera del modulo *threading*, por ejemplo directamente de " +"código en C. Los objetos de hilos *dummy* tienen funcionalidad limitada; " +"siempre se consideran vivos y demoníacos, y no pueden se les puede aplicar " +"el método :meth:`~Thread.join`. Nunca son eliminados, ya que es imposible " +"detectar la terminación de hilos extranjeros." #: ../Doc/library/threading.rst:258 msgid "" "This constructor should always be called with keyword arguments. Arguments " "are:" msgstr "" +"Este constructor siempre debe ser llamado con argumentos de palabra clave. " +"Los argumentos son:" #: ../Doc/library/threading.rst:261 msgid "" "*group* should be ``None``; reserved for future extension when a :class:" "`ThreadGroup` class is implemented." msgstr "" +"*group* debe ser `None`; reservado para una futura extensión cuando se " +"implemente una clase :class:`ThreadGroup`." #: ../Doc/library/threading.rst:264 msgid "" "*target* is the callable object to be invoked by the :meth:`run` method. " "Defaults to ``None``, meaning nothing is called." msgstr "" +"*target* es el objeto invocable a ser invocado por el método :meth:`run`. " +"Por defecto es ``None``, lo que significa que nada es llamado." #: ../Doc/library/threading.rst:267 msgid "" "*name* is the thread name. By default, a unique name is constructed of the " "form \"Thread-*N*\" where *N* is a small decimal number." msgstr "" +"*name* es el nombre del hilo. Por defecto, se construye un nombre único con " +"la forma \"*Thread*-*N*\" donde *N* es un número decimal pequeño." #: ../Doc/library/threading.rst:270 msgid "" "*args* is the argument tuple for the target invocation. Defaults to ``()``." msgstr "" +"*args* es la tupla de argumento para la invocación objetivo. Por defecto es " +"``()``." #: ../Doc/library/threading.rst:272 msgid "" "*kwargs* is a dictionary of keyword arguments for the target invocation. " "Defaults to ``{}``." msgstr "" +"*kwargs* es un diccionario de argumentos de palabra clave para la invocación " +"objetivo. Por defecto es ``{}``." #: ../Doc/library/threading.rst:275 msgid "" @@ -379,6 +521,9 @@ msgid "" "``None`` (the default), the daemonic property is inherited from the current " "thread." msgstr "" +"Si no es ``None``, *daemon* establece explícitamente si el hilo es " +"demoníaco. Si es ``None`` (el valor por defecto), la propiedad demoníaca es " +"heredada del hilo actual." #: ../Doc/library/threading.rst:279 msgid "" @@ -386,14 +531,17 @@ msgid "" "base class constructor (``Thread.__init__()``) before doing anything else to " "the thread." msgstr "" +"Si la subclase sobrescribe el constructor, debe asegurarse de invocar al " +"constructor de la clase base (``Thread.__init__()``) antes de hacer " +"cualquier otra cosa al hilo." #: ../Doc/library/threading.rst:283 msgid "Added the *daemon* argument." -msgstr "" +msgstr "Se agregó el argumento *daemon*." #: ../Doc/library/threading.rst:288 msgid "Start the thread's activity." -msgstr "" +msgstr "Inicia la actividad del hilo." #: ../Doc/library/threading.rst:290 msgid "" @@ -401,16 +549,21 @@ msgid "" "object's :meth:`~Thread.run` method to be invoked in a separate thread of " "control." msgstr "" +"Debe ser llamada máximo una vez por objeto hilo. Se encarga de que el " +"método :meth:`~Thread.run` del objeto sea invocado en un hilo de control " +"separado." #: ../Doc/library/threading.rst:294 msgid "" "This method will raise a :exc:`RuntimeError` if called more than once on the " "same thread object." msgstr "" +"Este método lanzará un :exc:`RuntimeError` si se llama más de una vez en el " +"mismo objeto hilo." #: ../Doc/library/threading.rst:299 msgid "Method representing the thread's activity." -msgstr "" +msgstr "Método que representa la actividad del hilo." #: ../Doc/library/threading.rst:301 msgid "" @@ -419,6 +572,10 @@ msgid "" "*target* argument, if any, with positional and keyword arguments taken from " "the *args* and *kwargs* arguments, respectively." msgstr "" +"Se puede sobrescribir este método en una subclase. El método estándar :meth:" +"`run` invoca el objeto invocable pasado al constructor del objeto como " +"argumento *target*, si lo hay, con argumentos posicionales y de palabra " +"clave tomados de los argumentos *args* y *kwargs*, respectivamente." #: ../Doc/library/threading.rst:308 msgid "" @@ -427,6 +584,10 @@ msgid "" "normally or through an unhandled exception -- or until the optional timeout " "occurs." msgstr "" +"Espera a que el hilo termine. Esto bloquea el hilo llamador hasta que el " +"hilo cuyo método :meth:`~Thread.join` es llamado finalice -- ya sea " +"normalmente o a través de una excepción no gestionada -- o hasta que el " +"tiempo de espera opcional caduque." #: ../Doc/library/threading.rst:313 msgid "" @@ -437,16 +598,24 @@ msgid "" "whether a timeout happened -- if the thread is still alive, the :meth:" "`~Thread.join` call timed out." msgstr "" +"Cuando se presenta un argumento *timeout* y no es ``None``, debe ser un " +"número de punto flotante que especifique un tiempo de espera en segundos (o " +"en fracciones de segundo) para la operación . Ya que :meth:`~Thread.join` " +"siempre retorna ``None``, se debe llamar a :meth:`~Thread.is_alive` después " +"de :meth:`~Thread.join` para decidir si acaso caducó el tiempo de espera -- " +"si el hilo todavía está vivo, la llamada a :meth:`~Thread.join` caducó." #: ../Doc/library/threading.rst:320 msgid "" "When the *timeout* argument is not present or ``None``, the operation will " "block until the thread terminates." msgstr "" +"Cuando el argumento *timeout* no se presenta o es ``None``, la operación " +"bloqueará hasta que el hilo termine." #: ../Doc/library/threading.rst:323 msgid "A thread can be :meth:`~Thread.join`\\ ed many times." -msgstr "" +msgstr "A un hilo se le puede aplicar :meth:`~Thread.join` muchas veces." #: ../Doc/library/threading.rst:325 msgid "" @@ -455,6 +624,10 @@ msgid "" "to :meth:`~Thread.join` a thread before it has been started and attempts to " "do so raise the same exception." msgstr "" +":meth:`~Thread.join` lanza un :exc:`RuntimeError` si se intenta unir el hilo " +"actual ya que ello generaría un punto muerto. También es un error aplicar :" +"meth:`~Thread.join` a un hilo antes de que haya sido iniciado y los intentos " +"de hacerlo lanzaran la misma excepción." #: ../Doc/library/threading.rst:332 msgid "" @@ -462,12 +635,17 @@ msgid "" "Multiple threads may be given the same name. The initial name is set by the " "constructor." msgstr "" +"Un *string* utilizado con propósitos de identificación. No posee semántica. " +"Se puede dar el mismo nombre a múltiples hilos. El nombre inicial es " +"establecido por el constructor." #: ../Doc/library/threading.rst:339 msgid "" "Old getter/setter API for :attr:`~Thread.name`; use it directly as a " "property instead." msgstr "" +"Antigua API *getter/setter* para :attr:`~Thread.name`; úsese en cambio " +"directamente como una propiedad." #: ../Doc/library/threading.rst:344 msgid "" @@ -477,6 +655,11 @@ msgid "" "another thread is created. The identifier is available even after the " "thread has exited." msgstr "" +"El 'identificador de hilo' de este hilo o ``None`` si el hilo no ha sido " +"iniciado. Es un entero distinto de cero. Ver la función :func:`get_ident`. " +"Los identificadores de hilos pueden ser reciclados cuando un hilo finaliza y " +"otro hilo es creado. El identificador está disponible incuso después de que " +"el hilo ha abandonado." #: ../Doc/library/threading.rst:352 msgid "" @@ -487,6 +670,13 @@ msgid "" "uniquely identify this particular thread system-wide (until the thread " "terminates, after which the value may be recycled by the OS)." msgstr "" +"La ID integral nativa de este hilo. Es un entero no negativo, o ``None`` si " +"el hilo no ha sido iniciado. Ver la función :func:`get_native_id`. Ésta " +"representa la *Thread ID* (``TID``) tal como haya sido asignada al hilo por " +"el SO (*kernel*). Su valor puede puede ser utilizado para identificar " +"específicamente a este hilo en particular a través de todo el sistema (hasta " +"que el hilo termina, luego de lo cual el valor puede ser reciclado por el " +"SO)." #: ../Doc/library/threading.rst:362 msgid "" @@ -494,15 +684,20 @@ msgid "" "wide) from the time the thread is created until the thread has been " "terminated." msgstr "" +"Similar a las *Process IDs*, las *Thread IDs* sólo son válidas (garantizadas " +"como únicas a través de todo el sistema) desde el momento en que se crea el " +"hilo hasta que el hilo es finalizado." #: ../Doc/library/threading.rst:367 msgid "" ":ref:`Availability `: Requires :func:`get_native_id` function." msgstr "" +":ref:`Disponibilidad `: Requiere la función :func:" +"`get_native_id`." #: ../Doc/library/threading.rst:372 msgid "Return whether the thread is alive." -msgstr "" +msgstr "Retornar si acaso el hilo está vivo." #: ../Doc/library/threading.rst:374 msgid "" @@ -510,6 +705,10 @@ msgid "" "starts until just after the :meth:`~Thread.run` method terminates. The " "module function :func:`.enumerate` returns a list of all alive threads." msgstr "" +"Este método retorna ``True`` desde justo antes de que el método :meth:" +"`~Thread.run` inicie hasta junto antes de que el método :meth:`~Thread.run` " +"termine. La función :func:`.enumerate` del módulo retorna una lista de todos " +"los hilos vivos." #: ../Doc/library/threading.rst:380 msgid "" @@ -520,17 +719,27 @@ msgid "" "therefore all threads created in the main thread default to :attr:`~Thread." "daemon` = ``False``." msgstr "" +"Un valor booleano que indica si este hilo es un hilo demonio (*True*) o no " +"(*False*). Debe ser establecido antes de que se llame a :meth:`~Thread." +"start`, de lo contrario se lanzará un :exc:`RuntimeError`. Su valor inicial " +"se hereda del hilo creador; el hilo principal no es un hilo demonio y por lo " +"tanto todos los hilos creados en el hilo principal tienen por defecto un " +"valor :attr:`~Thread.daemon` = ``False``." #: ../Doc/library/threading.rst:387 msgid "" "The entire Python program exits when no alive non-daemon threads are left." msgstr "" +"El programa de Python en su totalidad finaliza cuando no queda ningún hilo " +"no-demonio vivo." #: ../Doc/library/threading.rst:392 msgid "" "Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a " "property instead." msgstr "" +"Antigua API *getter/setter* para :attr:`~Thread.daemon`; úsese en cambio " +"directamente como una propiedad." #: ../Doc/library/threading.rst:398 msgid "" @@ -542,10 +751,18 @@ msgid "" "ProcessPoolExecutor`. However, threading is still an appropriate model if " "you want to run multiple I/O-bound tasks simultaneously." msgstr "" +"En CPython, debido al :term:`Global Interpreter Lock` (bloqueo global del " +"intérprete), un solo hilo puede ejecutar código de Python a la vez (a pesar " +"de que algunas librerías orientadas al desempeño pueden superar esta " +"limitación). Si se desea que una aplicación haga mejor uso de los recursos " +"computacionales de máquinas multi-núcleo, se recomienda usar :mod:" +"`multiprocessing` o :class:`concurrent.futures.ProcessPoolExecutor`. De " +"todas maneras, trabajar con hilos todavía es un modelo apropiado si se " +"quiere correr múltiples tareas limitadas por E/S simultáneamente." #: ../Doc/library/threading.rst:411 msgid "Lock Objects" -msgstr "" +msgstr "Objetos tipo *lock*" #: ../Doc/library/threading.rst:413 msgid "" @@ -554,6 +771,10 @@ msgid "" "synchronization primitive available, implemented directly by the :mod:" "`_thread` extension module." msgstr "" +"Un *lock* primitivo es un primitivo de sincronización que no pertenece a " +"ningún hilo en particular cuando está cerrado. En Python, es el primitivo de " +"sincronización de más bajo nivel actualmente disponible, implementado " +"directamente por el módulo de extensión :mod:`_thread`." #: ../Doc/library/threading.rst:418 msgid "" @@ -568,10 +789,23 @@ msgid "" "state to unlocked and returns immediately. If an attempt is made to release " "an unlocked lock, a :exc:`RuntimeError` will be raised." msgstr "" +"Un *lock* primitivo está en uno de dos estados, \"cerrado\" o \"abierto" +"\" (*locked*/*unlocked*). Se crea en estado abierto. Tiene dos métodos " +"básicos, :meth:`~Lock.acquire` (adquirir) y :meth:`~Lock.release` (liberar). " +"Cuando el estado es *abierto*, :meth:`~Lock.acquire` cambia el estado a " +"cerrado y retorna inmediatamente. Cuando el estado es *cerrado*, :meth:" +"`~Lock.acquire` bloquea hasta que una llamada a :meth:`~Lock.release` en " +"otro hilo lo cambie a abierto, luego la llamada a :meth:`~Lock.acquire` lo " +"restablece a cerrado y retorna. El método :meth:`~Lock.release` sólo debe " +"ser llamado en el estado cerrado; cambia el estado a abierto y retorna " +"inmediatamente. Si se realiza un intento de liberar un *lock* abierto, se " +"lanzará un :exc:`RuntimeError`." #: ../Doc/library/threading.rst:429 msgid "Locks also support the :ref:`context management protocol `." msgstr "" +"Los *locks* también soportan el :ref:`protocolo de gestión de contexto `." #: ../Doc/library/threading.rst:431 msgid "" @@ -580,10 +814,14 @@ msgid "" "release` call resets the state to unlocked; which one of the waiting threads " "proceeds is not defined, and may vary across implementations." msgstr "" +"Cuando más de un hilo está bloqueado en :meth:`~Lock.acquire` esperando que " +"el estado sea abierto, sólo un hilo procederá cuando una llamada a :meth:" +"`~Lock.release` restablezca el estado a abierto; cuál de los hilos en espera " +"procederá no está definido, y puede variar a través de las implementaciones." #: ../Doc/library/threading.rst:436 msgid "All methods are executed atomically." -msgstr "" +msgstr "Todos los métodos se ejecutan de manera atómica." #: ../Doc/library/threading.rst:441 msgid "" @@ -591,6 +829,9 @@ msgid "" "lock, subsequent attempts to acquire it block, until it is released; any " "thread may release it." msgstr "" +"La clase que implemente los objetos *lock* primitivos. Una vez que un hilo " +"ha adquirido un *lock*, intentos subsecuentes por adquirirlo bloquearán, " +"hasta que sea liberado; cualquier hilo puede liberarlo." #: ../Doc/library/threading.rst:445 msgid "" @@ -598,16 +839,22 @@ msgid "" "of the most efficient version of the concrete Lock class that is supported " "by the platform." msgstr "" +"Nótese que ``Lock`` es una función de fábrica que retorna una instancia de " +"la versión más eficiente de la clase *Lock* concreta soportada por la " +"plataforma." #: ../Doc/library/threading.rst:452 ../Doc/library/threading.rst:532 msgid "Acquire a lock, blocking or non-blocking." -msgstr "" +msgstr "Adquirir un *lock*, bloqueante o no bloqueante." #: ../Doc/library/threading.rst:454 msgid "" "When invoked with the *blocking* argument set to ``True`` (the default), " "block until the lock is unlocked, then set it to locked and return ``True``." msgstr "" +"Cuando se invoca con el argumento *blocking* establecido como ``True`` (el " +"valor por defecto), bloquea hasta que el *lock* se abra, luego lo establece " +"como cerrado y retorna ``True``." #: ../Doc/library/threading.rst:457 msgid "" @@ -615,6 +862,9 @@ msgid "" "a call with *blocking* set to ``True`` would block, return ``False`` " "immediately; otherwise, set the lock to locked and return ``True``." msgstr "" +"Cuando es invocado con el argumento *blocking* como ``False``, no bloquea. " +"Si una llamada con *blocking* establecido como ``True`` bloqueara, retorna " +"``Falso`` inmediatamente; de otro modo, cierra el *lock* y retorna ``True``." #: ../Doc/library/threading.rst:461 msgid "" @@ -624,29 +874,40 @@ msgid "" "specifies an unbounded wait. It is forbidden to specify a *timeout* when " "*blocking* is false." msgstr "" +"Cuando se invoca con el argumento de punto flotante *timeout* fijado a un " +"valor positivo, bloquea por a lo más el número de segundos especificado en " +"*timeout* y mientras el *lock* no pueda ser adquirido. Un argumento " +"*timeout* de \"-1\" especifica una espera ilimitada. No está admitido " +"especificar un *timeout* cuando *blocking* es falso." #: ../Doc/library/threading.rst:467 msgid "" "The return value is ``True`` if the lock is acquired successfully, ``False`` " "if not (for example if the *timeout* expired)." msgstr "" +"El valor de retorno es ``True`` si el *lock* es adquirido con éxito, " +"``Falso`` si no (por ejemplo si *timeout* expiró)." #: ../Doc/library/threading.rst:470 ../Doc/library/threading.rst:554 #: ../Doc/library/threading.rst:799 msgid "The *timeout* parameter is new." -msgstr "" +msgstr "El parámetro *timeout* es nuevo." #: ../Doc/library/threading.rst:473 msgid "" "Lock acquisition can now be interrupted by signals on POSIX if the " "underlying threading implementation supports it." msgstr "" +"La adquisición de un *lock* ahora puede ser interrumpida por señales en " +"POSIX si la implementación de hilado subyacente lo soporta." #: ../Doc/library/threading.rst:480 msgid "" "Release a lock. This can be called from any thread, not only the thread " "which has acquired the lock." msgstr "" +"Libera un *lock*. Puede ser llamado desde cualquier hilo, no solo el hilo " +"que ha adquirido el *lock*." #: ../Doc/library/threading.rst:483 msgid "" @@ -654,22 +915,26 @@ msgid "" "threads are blocked waiting for the lock to become unlocked, allow exactly " "one of them to proceed." msgstr "" +"Cuando el *lock* está cerrado, lo restablece a abierto, y retorna. Si " +"cualquier otro hilo está bloqueado esperando que el *lock* se abra, permite " +"que exactamente uno de ellos proceda." #: ../Doc/library/threading.rst:487 msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised." msgstr "" +"Cuando se invoca en un *lock* abierto, se lanza un :exc:`RuntimeError`." #: ../Doc/library/threading.rst:489 ../Doc/library/threading.rst:570 msgid "There is no return value." -msgstr "" +msgstr "No hay valor de retorno." #: ../Doc/library/threading.rst:493 msgid "Return true if the lock is acquired." -msgstr "" +msgstr "Retorna *true* si el *lock* ha sido adquirido." #: ../Doc/library/threading.rst:500 msgid "RLock Objects" -msgstr "" +msgstr "Objetos *Rlock*" #: ../Doc/library/threading.rst:502 msgid "" @@ -679,6 +944,12 @@ msgid "" "state used by primitive locks. In the locked state, some thread owns the " "lock; in the unlocked state, no thread owns it." msgstr "" +"Un *lock* reentrante es un primitivo de sincronización que puede ser " +"adquirido múltiples veces por el mismo hilo. Internamente, utiliza el " +"concepto de \"hilo dueño\" y \"nivel de recursividad\" además del estado " +"abierto/cerrado utilizado por los *locks* primitivos. Si está en estado " +"cerrado, algún hilo es dueño del *lock*; si está en estado abierto, ningún " +"hilo es dueño." #: ../Doc/library/threading.rst:508 msgid "" @@ -690,12 +961,21 @@ msgid "" "unlocked and allows another thread blocked in :meth:`~Lock.acquire` to " "proceed." msgstr "" +"Para cerrar el *lock*, un hilo llama a su método :meth:`~RLock.acquire`; " +"esto retorna una vez que el hilo se ha adueñado del *lock*. Para abrir el " +"*lock*, un hilo llama a su método :meth:`~Lock.release`. Pares de llamadas :" +"meth:`~Lock.acquire`/:meth:`~Lock.release` pueden anidarse; sólo el :meth:" +"`~Lock.release` final (el :meth:`~Lock.release` del par más externo) " +"restablece el *lock* a abierto y permite que otro hilo bloqueado en :meth:" +"`~Lock.acquire` proceda." #: ../Doc/library/threading.rst:515 msgid "" "Reentrant locks also support the :ref:`context management protocol `." msgstr "" +"Los *locks* reentrantes también soportan el :ref:`protocolo de manejo de " +"contextos `." #: ../Doc/library/threading.rst:520 msgid "" @@ -704,6 +984,10 @@ msgid "" "reentrant lock, the same thread may acquire it again without blocking; the " "thread must release it once for each time it has acquired it." msgstr "" +"Esta clase implementa objetos tipo *lock* reentrantes. Un *lock* reentrante " +"debe ser liberado por el hilo que lo adquirió. Una vez que un hilo ha " +"adquirido un *lock* reentrante, el mismo hilo puede adquirirlo otra vez sin " +"bloquearse; el hilo debe liberarlo una vez por vez que lo adquiere." #: ../Doc/library/threading.rst:525 msgid "" @@ -711,6 +995,9 @@ msgid "" "of the most efficient version of the concrete RLock class that is supported " "by the platform." msgstr "" +"Nótese que ``RLock`` en realidad es una función fábrica que retorna una " +"instancia de la versión más eficiente de la clase RLock concreta que sea " +"soportada por la plataforma." #: ../Doc/library/threading.rst:534 msgid "" @@ -722,12 +1009,21 @@ msgid "" "waiting until the lock is unlocked, only one at a time will be able to grab " "ownership of the lock. There is no return value in this case." msgstr "" +"Cuando se invoca sin argumentos: si este hilo ya es dueño del *lock*, " +"incrementa el nivel de recursividad en uno, y retorna inmediatamente. De " +"otro modo, si otro hilo es dueño del *lock*, bloquea hasta que se abra el " +"*lock*. Una vez que el *lock* se abra (ningún hilo sea su dueño), se adueña, " +"establece el nivel de recursividad en uno, y retorna. Si más de un hilo está " +"bloqueado esperando que sea abra el *lock*, solo uno a la vez podrá " +"apoderarse del *lock*. No hay valor de retorno en este caso." #: ../Doc/library/threading.rst:542 msgid "" "When invoked with the *blocking* argument set to true, do the same thing as " "when called without arguments, and return ``True``." msgstr "" +"Cuando se invoca con el argumento *blocking* fijado en *true*, hace lo mismo " +"que cuando se llama sin argumentos y retorna ``True``." #: ../Doc/library/threading.rst:545 msgid "" @@ -736,6 +1032,9 @@ msgid "" "otherwise, do the same thing as when called without arguments, and return " "``True``." msgstr "" +"Cuando se invoca con el argumento *blocking* fijado a falso, no bloquea. Si " +"una llamada sin argumento bloquease, retorna ``False`` inmediatamente; de " +"otro modo, hace lo mismo que al llamarse sin argumentos, y retorna ``True``." #: ../Doc/library/threading.rst:549 msgid "" @@ -744,6 +1043,11 @@ msgid "" "long as the lock cannot be acquired. Return ``True`` if the lock has been " "acquired, false if the timeout has elapsed." msgstr "" +"Cuando se invoca con el argumento de coma flotante *timeout* fijado a un " +"valor positivo, bloquea por máximo el número de segundos especificado por " +"*timeout* y mientras el *lock* no pueda ser adquirido. Retorna ``True`` si " +"el *lock* ha sido adquirido, falso si el tiempo de espera *timeout* ha " +"caducado." #: ../Doc/library/threading.rst:560 msgid "" @@ -753,16 +1057,25 @@ msgid "" "exactly one of them to proceed. If after the decrement the recursion level " "is still nonzero, the lock remains locked and owned by the calling thread." msgstr "" +"Libera un *lock*, disminuyendo el nivel de recursividad. Si después de la " +"disminución es cero, restablece el *lock* a abierto (no perteneciente a " +"ningún hilo), y si cualquier otro hilo está bloqueado esperando que se abra " +"el *lock*, permite que exactamente uno de ellos proceda. Si luego de la " +"disminución el nivel de recursividad todavía no es cero, el *lock* permanece " +"cerrado y perteneciente al hilo llamador." #: ../Doc/library/threading.rst:566 msgid "" "Only call this method when the calling thread owns the lock. A :exc:" "`RuntimeError` is raised if this method is called when the lock is unlocked." msgstr "" +"Solo llámese este método cuando el hilo llamador sea dueño del *lock*. Se " +"lanza un :exc:`RuntimeError` si se llama este método cuando el *lock* esta " +"abierto." #: ../Doc/library/threading.rst:576 msgid "Condition Objects" -msgstr "" +msgstr "Objetos condicionales" #: ../Doc/library/threading.rst:578 msgid "" @@ -771,6 +1084,10 @@ msgid "" "when several condition variables must share the same lock. The lock is part " "of the condition object: you don't have to track it separately." msgstr "" +"Una condición variable siempre va asociada a algún tipo de *lock*. éste " +"puede ser provisto o se creará uno por defecto. Proveer uno es útil cuando " +"varias variables de condición deben compartir el mismo *lock*. El *lock* es " +"parte del objeto condicional: no es necesario rastrearlo por separado." #: ../Doc/library/threading.rst:583 msgid "" @@ -780,6 +1097,11 @@ msgid "" "`~Condition.release` methods also call the corresponding methods of the " "associated lock." msgstr "" +"Una condición variable obedece el :ref:`protocolo de gestión de " +"contexto`: al usar la declaración ``with`` se adquiere el *lock* " +"asociado por la duración del bloque contenido. Los métodos :meth:`~Condition." +"acquire` y :meth:`~Condition.release` también llaman los métodos " +"correspondientes del *lock* asociado." #: ../Doc/library/threading.rst:589 msgid "" @@ -789,6 +1111,12 @@ msgid "" "notify_all`. Once awakened, :meth:`~Condition.wait` re-acquires the lock " "and returns. It is also possible to specify a timeout." msgstr "" +"Otros métodos deben llamarse con el *lock* asociado conservado. El método :" +"meth:`~Condition.wait` libera el *lock*, y luego bloquea hasta que otro hilo " +"lo despierte llamando :meth:`~Condition.notify` o :meth:`~Condition." +"notify_all`. Una vez que ha sido despertado, :meth:`~Condition.wait` re-" +"adquiere el *lock* y retorna. También es posible especificar un tiempo de " +"espera." #: ../Doc/library/threading.rst:595 msgid "" @@ -796,6 +1124,10 @@ msgid "" "the condition variable, if any are waiting. The :meth:`~Condition." "notify_all` method wakes up all threads waiting for the condition variable." msgstr "" +"El método :meth:`~Condition.notify` despierta a uno de los hilos que esperan " +"a la condición variable, si es que alguno espera. El método :meth:" +"`~Condition.notify_all` despierta a todos los hilos que estén esperando a la " +"condición variable." #: ../Doc/library/threading.rst:599 msgid "" @@ -805,6 +1137,12 @@ msgid "" "immediately, but only when the thread that called :meth:`~Condition.notify` " "or :meth:`~Condition.notify_all` finally relinquishes ownership of the lock." msgstr "" +"Nota: Los métodos :meth:`~Condition.notify` y :meth:`~Condition.notify_all` " +"no liberan el *lock*; esto significa que el hilo o los hilos que han sido " +"despertados no retornaran de su llamada de :meth:`~Condition.wait` " +"inmediatamente, sino solo una vez que el hilo que haya llamado a :meth:" +"`~Condition.notify` o :meth:`~Condition.notify_all` renuncie finalmente a la " +"propiedad del *lock*." #: ../Doc/library/threading.rst:605 msgid "" @@ -817,6 +1155,15 @@ msgid "" "waiters. For example, the following code is a generic producer-consumer " "situation with unlimited buffer capacity::" msgstr "" +"El estilo típico de programación con variables condicionales utiliza el " +"*lock* para sincronizar el acceso a algún estado compartido; hilos que estén " +"interesados en un cambio de estado en particular llamarán a :meth:" +"`~Condition.wait` reiteradamente hasta que vean el estado deseado, mientras " +"que los hilos que modifiquen el estado llamarán a :meth:`~Condition.notify` " +"o a :meth:`~Condition.notify_all` cuando cambien el estado de modo que " +"pudiera ser que el el estado sea el deseado por alguno de los hilos en " +"espera. Por ejemplo, el siguiente código es una situación genérica de " +"productor-consumidor con capacidad de búfer ilimitada::" #: ../Doc/library/threading.rst:625 msgid "" @@ -827,6 +1174,13 @@ msgid "" "meth:`~Condition.wait_for` method can be used to automate the condition " "checking, and eases the computation of timeouts::" msgstr "" +"El bucle ``while`` que verifica la condición de la aplicación es necesario " +"porque :meth:`~Condition.wait` puede retornar después de una cantidad " +"arbitraria de tiempo, y la condición que dio pie a la llamada de :meth:" +"`~Condition.notify` puede ya no ser verdadera. Esto es inherente a la " +"programación multi-hilo. El método :meth:`~Condition.wait_for` puede usarse " +"para automatizar la revisión de condiciones, y facilita la computación de " +"tiempos de espera::" #: ../Doc/library/threading.rst:637 msgid "" @@ -836,12 +1190,18 @@ msgid "" "situation, adding one item to the buffer only needs to wake up one consumer " "thread." msgstr "" +"Para elegir entre :meth:`~Condition.notify` y :meth:`~Condition.notify_all`, " +"considérese si un cambio de estado puede ser interesante para uno o varios " +"hilos en espera. Por ejemplo en una típica situación productor-consumidor, " +"agregar un elemento al búfer sólo necesita despertar un hilo consumidor." #: ../Doc/library/threading.rst:645 msgid "" "This class implements condition variable objects. A condition variable " "allows one or more threads to wait until they are notified by another thread." msgstr "" +"Esta clase implementa objetos de condición variable. Una condición variable " +"permite que uno o más hilos esperen hasta que sean notificados por otro hilo." #: ../Doc/library/threading.rst:648 msgid "" @@ -849,24 +1209,33 @@ msgid "" "or :class:`RLock` object, and it is used as the underlying lock. Otherwise, " "a new :class:`RLock` object is created and used as the underlying lock." msgstr "" +"Si se provee un argumento *lock* distinto de ``None``, debe ser un objeto :" +"class:`Lock` o :class:`RLock`, y se utiliza como el *lock* subyacente. De " +"otro modo, se crea un nuevo objeto :class:`RLock` y se utiliza como el " +"*lock* subyacente." #: ../Doc/library/threading.rst:652 ../Doc/library/threading.rst:774 #: ../Doc/library/threading.rst:817 ../Doc/library/threading.rst:869 #: ../Doc/library/threading.rst:938 msgid "changed from a factory function to a class." -msgstr "" +msgstr "cambiado de función de fábrica a una clase." #: ../Doc/library/threading.rst:657 msgid "" "Acquire the underlying lock. This method calls the corresponding method on " "the underlying lock; the return value is whatever that method returns." msgstr "" +"Adquiere el *lock* subyacente. Este método llama al método correspondiente " +"sobre el *lock* subyacente; el valor de retorno es lo que retorne aquel " +"método." #: ../Doc/library/threading.rst:662 msgid "" "Release the underlying lock. This method calls the corresponding method on " "the underlying lock; there is no return value." msgstr "" +"Libera el *lock* subyacente. Este método llama al método correspondiente en " +"el *lock* subyacente; no tiene valor de retorno." #: ../Doc/library/threading.rst:667 msgid "" @@ -874,6 +1243,9 @@ msgid "" "acquired the lock when this method is called, a :exc:`RuntimeError` is " "raised." msgstr "" +"Espera hasta ser notificado o hasta que el tiempo de espera caduque. Si el " +"hilo invocador no ha adquirido el *lock* cuando este método es llamado, se " +"lanza un :exc:`RuntimeError`." #: ../Doc/library/threading.rst:671 msgid "" @@ -882,6 +1254,11 @@ msgid "" "condition variable in another thread, or until the optional timeout occurs. " "Once awakened or timed out, it re-acquires the lock and returns." msgstr "" +"Este método libera el *lock* subyacente, y luego bloquea hasta ser " +"despertado por una llamada a :meth:`notify` o :meth:`notify_all` para la " +"misma condición variable en otro hilo, o hasta que el tiempo de espera " +"opcional se cumpla. Una vez que ha sido despertado o el tiempo de espera ha " +"pasado, re-adquiere el *lock* y retorna." #: ../Doc/library/threading.rst:676 msgid "" @@ -889,6 +1266,9 @@ msgid "" "floating point number specifying a timeout for the operation in seconds (or " "fractions thereof)." msgstr "" +"Cuando haya un argumento *timeout* presente y no sea ``None``, debe ser un " +"número de punto flotante que especifique un tiempo de espera para la " +"operación en segundos (o fracciones de segundo)." #: ../Doc/library/threading.rst:680 msgid "" @@ -899,16 +1279,25 @@ msgid "" "been recursively acquired several times. Another internal interface is then " "used to restore the recursion level when the lock is reacquired." msgstr "" +"Cuando el *lock* subyacente es un :class:`RLock`, no se libera utilizando " +"su método :meth:`release`, ya que esto podría no abrir realmente el *lock* " +"cuando haya sido adquirido múltiples veces recursivamente. En cambio, se usa " +"una interfaz interna de la clase :class:`RLock`, que lo abre realmente " +"incluso cuando haya sido adquirido múltiples veces recursivamente. Otra " +"interfaz interna se usa luego para restablecer el nivel de recursividad " +"cuando el *lock* es readquirido." #: ../Doc/library/threading.rst:688 msgid "" "The return value is ``True`` unless a given *timeout* expired, in which case " "it is ``False``." msgstr "" +"El valor de retorno es ``True`` a menos que un *timeout* dado haya expirado, " +"en cuyo caso será ``False``." #: ../Doc/library/threading.rst:691 ../Doc/library/threading.rst:903 msgid "Previously, the method always returned ``None``." -msgstr "" +msgstr "Previamente, el método siempre retornaba ``None``." #: ../Doc/library/threading.rst:696 msgid "" @@ -916,6 +1305,9 @@ msgid "" "which result will be interpreted as a boolean value. A *timeout* may be " "provided giving the maximum time to wait." msgstr "" +"Espera a que una condición se evalúe como verdadera. *predicate* debe ser un " +"invocable cuyo resultado se interpretará como un valor booleano. Se puede " +"proveer un *timeout* que especifique el máximo tiempo de espera." #: ../Doc/library/threading.rst:700 msgid "" @@ -924,12 +1316,18 @@ msgid "" "value of the predicate and will evaluate to ``False`` if the method timed " "out." msgstr "" +"Este método utilitario puede llamar a :meth:`wait` reiteradas veces hasta " +"que se satisfaga el predicado, o hasta que la espera caduque. El valor de " +"retorno es el último valor de retorno del predicado y se evaluará a " +"``False`` si el método ha caducado." #: ../Doc/library/threading.rst:705 msgid "" "Ignoring the timeout feature, calling this method is roughly equivalent to " "writing::" msgstr "" +"Al ignorar la propiedad *feature*, llamar a este método equivale vagamente a " +"escribir::" #: ../Doc/library/threading.rst:711 msgid "" @@ -937,6 +1335,9 @@ msgid "" "when called and is re-acquired on return. The predicate is evaluated with " "the lock held." msgstr "" +"Por ende, aplican las mismas reglas que con :meth:`wait`: El *lock* debe ser " +"conservado cuando se llame y es re-adquirido al momento del retorno. El " +"predicado se evalúa con el *lock* conservado." #: ../Doc/library/threading.rst:719 msgid "" @@ -944,12 +1345,17 @@ msgid "" "calling thread has not acquired the lock when this method is called, a :exc:" "`RuntimeError` is raised." msgstr "" +"Por defecto, despierta a un hilo que esté esperando por esta condición, si " +"lo existe. Si el hilo llamador no ha adquirido el *lock* cuando se llama " +"este método, se lanza un :exc:`RuntimeError`." #: ../Doc/library/threading.rst:723 msgid "" "This method wakes up at most *n* of the threads waiting for the condition " "variable; it is a no-op if no threads are waiting." msgstr "" +"Este método despierta como máximo *n* de los hilos que estén esperando por " +"la condición variable; no es una opción si no hay hilos esperando." #: ../Doc/library/threading.rst:726 msgid "" @@ -958,6 +1364,10 @@ msgid "" "future, optimized implementation may occasionally wake up more than *n* " "threads." msgstr "" +"La implementación actual despierta exactamente *n* hilos, si hay por lo " +"menos *n* hilos esperando. Sin embargo, no es seguro apoyarse en este " +"comportamiento. A futuro, una implementación optimizada podría " +"ocasionalmente despertar a más de *n* hilos." #: ../Doc/library/threading.rst:731 msgid "" @@ -965,6 +1375,9 @@ msgid "" "until it can reacquire the lock. Since :meth:`notify` does not release the " "lock, its caller should." msgstr "" +"Nota: un hilo que ha sido despertado no retorna realmente de su llamada a :" +"meth:`wait` hasta que pueda readquirir el *lock*. Ya que :meth:`notify` no " +"libera el *lock*, su llamador debiera hacerlo." #: ../Doc/library/threading.rst:737 msgid "" @@ -973,10 +1386,14 @@ msgid "" "thread has not acquired the lock when this method is called, a :exc:" "`RuntimeError` is raised." msgstr "" +"Despierta a todos los hilos que esperen por esta condición. Este método " +"actúa como :meth:`notify`, pero despierta a todos los hilos en espera en vez " +"de a uno. Si el hilo llamador no ha adquirido el *lock* cuando se llama a " +"este método, se lanza un :exc:`RuntimeError`." #: ../Doc/library/threading.rst:746 msgid "Semaphore Objects" -msgstr "" +msgstr "Objetos semáforo" #: ../Doc/library/threading.rst:748 msgid "" @@ -985,6 +1402,10 @@ msgid "" "Dijkstra (he used the names ``P()`` and ``V()`` instead of :meth:`~Semaphore." "acquire` and :meth:`~Semaphore.release`)." msgstr "" +"Éste es uno de los primitivos de sincronización más antiguos en la historia " +"de las ciencias de la computación, inventado por el pionero en ciencias de " +"la computación holandés Edsger W. Dijkstra (él utilizó los nombres ``P()`` y " +"``V()`` en lugar de :meth:`~Semaphore.acquire` y :meth:`~Semaphore.release`)" #: ../Doc/library/threading.rst:753 msgid "" @@ -994,11 +1415,18 @@ msgid "" "finds that it is zero, it blocks, waiting until some other thread calls :" "meth:`~Semaphore.release`." msgstr "" +"Un semáforo administra un contador interno que se disminuye por cada llamada " +"a :meth:`~Semaphore.acquire` y se incrementa por cada llamada a :meth:" +"`~Semaphore.release`. El contador no puede bajar de cero; cuando :meth:" +"`~Semaphore.acquire` lo encuentra en cero, bloquea, esperando hasta que otro " +"hilo llame :meth:`~Semaphore.release`." #: ../Doc/library/threading.rst:759 msgid "" "Semaphores also support the :ref:`context management protocol `." msgstr "" +"Los semáforos también tienen soporte para el :ref:`protocolo de gestión de " +"contexto `." #: ../Doc/library/threading.rst:764 msgid "" @@ -1008,6 +1436,11 @@ msgid "" "blocks if necessary until it can return without making the counter negative. " "If not given, *value* defaults to 1." msgstr "" +"Esta clase implementa los objetos semáforo. Un semáforo gestiona un contador " +"atómico que representa el número de llamadas a :meth:`release` menos el " +"número de llamadas a :meth:`acquire`, más un valor inicial. El método :meth:" +"`acquire` bloquea si es necesario, hasta que pueda retornar sin volver el " +"contador negativo. Si no es provisto, el valor por defecto de *value* será 1." #: ../Doc/library/threading.rst:770 msgid "" @@ -1015,20 +1448,24 @@ msgid "" "defaults to ``1``. If the *value* given is less than 0, :exc:`ValueError` is " "raised." msgstr "" +"El argumento opcional da el *value* inicial al contador interno; por defecto " +"es ``1``. Si el *value* provisto es menor a 0; se lanza un :exc:`ValueError`." #: ../Doc/library/threading.rst:779 msgid "Acquire a semaphore." -msgstr "" +msgstr "Adquirir un semáforo." #: ../Doc/library/threading.rst:781 msgid "When invoked without arguments:" -msgstr "" +msgstr "Cuando se invoca sin argumentos:" #: ../Doc/library/threading.rst:783 msgid "" "If the internal counter is larger than zero on entry, decrement it by one " "and return ``True`` immediately." msgstr "" +"Si el contador interno es mayor a cero de entrada, lo disminuye en uno y " +"retorna ``True`` inmediatamente." #: ../Doc/library/threading.rst:785 msgid "" @@ -1038,6 +1475,11 @@ msgid "" "awoken by each call to :meth:`~Semaphore.release`. The order in which " "threads are awoken should not be relied on." msgstr "" +"Si el contador interno es cero de entrada, bloquea hasta ser despertado por " +"una llamada a :meth:`~Semaphore.release`. Una vez despierto (y el contador " +"sea mayor a 0), disminuye el contador en 1 y retorna ``True``. Se despertará " +"exactamente un hilo por cada llamada a :meth:`~Semaphore.release`. No " +"debiese confiarse en el orden en que los hilos sean despertados." #: ../Doc/library/threading.rst:791 msgid "" @@ -1045,6 +1487,9 @@ msgid "" "an argument would block, return ``False`` immediately; otherwise, do the " "same thing as when called without arguments, and return ``True``." msgstr "" +"Cuando se invoca con *blocking* fijado en falso, no bloquea. Si una llamada " +"sin un argumento bloquease, retorna ``Falso`` inmediatamente; de otro modo, " +"hace lo mismo que cuando se llama sin argumentos, y retorna ``True``." #: ../Doc/library/threading.rst:795 msgid "" @@ -1052,6 +1497,10 @@ msgid "" "*timeout* seconds. If acquire does not complete successfully in that " "interval, return ``False``. Return ``True`` otherwise." msgstr "" +"Cuando se invoca con *timeout* distinto de ``None``, bloqueará por un tiempo " +"máximo en segundos fijados en *timeout*. Si *acquire* no se completa " +"exitosamente en ese intervalo, retorna ``False``. De otro modo retorna " +"``True``." #: ../Doc/library/threading.rst:804 msgid "" @@ -1059,6 +1508,9 @@ msgid "" "zero on entry and another thread is waiting for it to become larger than " "zero again, wake up that thread." msgstr "" +"Libera un semáforo, incrementando el contador interno en uno. Cuando éste " +"haya sido cero de entrada y otro hilo esté esperando que sea nuevamente " +"mayor a cero, despierta a ese hilo." #: ../Doc/library/threading.rst:811 msgid "" @@ -1068,10 +1520,16 @@ msgid "" "resources with limited capacity. If the semaphore is released too many " "times it's a sign of a bug. If not given, *value* defaults to 1." msgstr "" +"Clase que implementa objetos de semáforo delimitados. Un semáforo delimitado " +"verifica que su valor actual no exceda su valor inicial. Si lo hace, se " +"lanza un :exc:`ValueError`. En la mayoría de las situaciones se utilizan los " +"semáforos para cuidar recursos con capacidad limitada. Si se libera el " +"semáforo demasiadas veces es signo de un *bug*. Si no se provee, el valor " +"por defecto de *value* será 1." #: ../Doc/library/threading.rst:824 msgid ":class:`Semaphore` Example" -msgstr "" +msgstr "Ejemplo de :class:`Semaphore`" #: ../Doc/library/threading.rst:826 msgid "" @@ -1080,12 +1538,19 @@ msgid "" "is fixed, you should use a bounded semaphore. Before spawning any worker " "threads, your main thread would initialize the semaphore::" msgstr "" +"Los semáforos suelen utilizarse para cuidar recursos con capacidad limitada, " +"por ejemplo, un servidor de base de datos. En cualquier situación en que el " +"tamaño de los recursos sea fijo, se debe usar un semáforo delimitado. Antes " +"de generar cualquier hilo de trabajo, tu hilo principal debe inicializar el " +"semáforo::" #: ../Doc/library/threading.rst:835 msgid "" "Once spawned, worker threads call the semaphore's acquire and release " "methods when they need to connect to the server::" msgstr "" +"Una vez que han sido generados, los hilos de trabajo llaman a los métodos " +"*acquire* y *release* cuando necesitan conectarse al servidor::" #: ../Doc/library/threading.rst:845 msgid "" @@ -1093,16 +1558,21 @@ msgid "" "which causes the semaphore to be released more than it's acquired will go " "undetected." msgstr "" +"El uso de semáforos delimitados reduce la posibilidad de que pase " +"inadvertido un error de programación que cause que el semáforo sea liberado " +"más veces de las que sea adquirido." #: ../Doc/library/threading.rst:852 msgid "Event Objects" -msgstr "" +msgstr "Objetos de eventos" #: ../Doc/library/threading.rst:854 msgid "" "This is one of the simplest mechanisms for communication between threads: " "one thread signals an event and other threads wait for it." msgstr "" +"Éste es uno de los mecanismos más simples de comunicación entre hilos: un " +"hilo señala un evento y otro hilo lo espera." #: ../Doc/library/threading.rst:857 msgid "" @@ -1110,6 +1580,10 @@ msgid "" "meth:`~Event.set` method and reset to false with the :meth:`~Event.clear` " "method. The :meth:`~Event.wait` method blocks until the flag is true." msgstr "" +"Un objeto de evento maneja una marca interna que puede ser establecida como " +"verdadera mediante el método :meth:`~Event.set` y restablecida a falsa " +"mediante el método :meth:`~Meth.clear`. El método :meth:`~Meth.wait` bloquea " +"hasta que la marca sea *true*." #: ../Doc/library/threading.rst:864 msgid "" @@ -1118,10 +1592,15 @@ msgid "" "`clear` method. The :meth:`wait` method blocks until the flag is true. The " "flag is initially false." msgstr "" +"Clase que implementa los objetos de evento. Un evento gestiona un indicador " +"que puede ser establecido a verdadero mediante el método :meth:`~Event.set` " +"y restablecido a falso con el método :meth:`clear`. El método :meth:`wait` " +"bloquea hasta que el indicador sea verdadero. El indicador es inicialmente " +"falso." #: ../Doc/library/threading.rst:874 msgid "Return ``True`` if and only if the internal flag is true." -msgstr "" +msgstr "Retorna ``True`` exclusivamente si el indicador interno es verdadero." #: ../Doc/library/threading.rst:878 msgid "" @@ -1129,6 +1608,9 @@ msgid "" "awakened. Threads that call :meth:`wait` once the flag is true will not " "block at all." msgstr "" +"Establece el indicador interno a verdadero. Todos los hilos que estén " +"esperando que se vuelva verdadero serán despertados. Los hilos que llaman a :" +"meth:`wait` una vez que el indicador marca verdadero no bloquearán." #: ../Doc/library/threading.rst:884 msgid "" @@ -1136,6 +1618,9 @@ msgid "" "will block until :meth:`.set` is called to set the internal flag to true " "again." msgstr "" +"Restablece el indicador a falso. Posteriormente, los hilos que llamen a :" +"meth:`wait` bloquearán hasta que se llame a :meth:`set` para establecer el " +"indicador interno a verdadero nuevamente." #: ../Doc/library/threading.rst:890 msgid "" @@ -1143,6 +1628,10 @@ msgid "" "entry, return immediately. Otherwise, block until another thread calls :" "meth:`.set` to set the flag to true, or until the optional timeout occurs." msgstr "" +"Bloquea hasta que el indicador interno sea verdadero. Si el indicador " +"interno es verdadero de entrada, retorna inmediatamente. De otro modo, " +"bloquea hasta que otro hilo llame a :meth:`.set` para establecer el " +"indicador a verdadero, o hasta que el tiempo de espera opcional caduque." #: ../Doc/library/threading.rst:894 msgid "" @@ -1150,6 +1639,9 @@ msgid "" "floating point number specifying a timeout for the operation in seconds (or " "fractions thereof)." msgstr "" +"Cuando se presenta un argumento para el tiempo de espera *timeout* distinto " +"de ``None``, debe ser un número de punto flotante que especifique un tiempo " +"de espera para la operación en segundos (o fracciones en su defecto)." #: ../Doc/library/threading.rst:898 msgid "" @@ -1158,10 +1650,14 @@ msgid "" "always return ``True`` except if a timeout is given and the operation times " "out." msgstr "" +"Este método retorna ``True`` exclusivamente si el indicador interno ha sido " +"establecido a verdadero, ya sea antes de la llamada a la espera o después de " +"que la espera inicie, por lo que siempre retorna ``True`` excepto si se " +"provee un tiempo de espera máximo y la operación caduca." #: ../Doc/library/threading.rst:910 msgid "Timer Objects" -msgstr "" +msgstr "Objetos temporizadores" #: ../Doc/library/threading.rst:912 msgid "" @@ -1170,6 +1666,10 @@ msgid "" "class:`Thread` and as such also functions as an example of creating custom " "threads." msgstr "" +"Esta clase representa una acción que sólo debe ejecutarse luego de que una " +"cierta cantidad de tiempo transcurra --- un temporizador. :class:`Timer` es " +"una subclase de :class:`Thread` y en tanto tal también funciona como un " +"ejemplo de creación de hilos personalizados." #: ../Doc/library/threading.rst:916 msgid "" @@ -1179,10 +1679,15 @@ msgid "" "executing its action may not be exactly the same as the interval specified " "by the user." msgstr "" +"Los temporizadores son iniciados, tal como los hilos, al llamarse su método :" +"meth:`~Timer.start`. El temporizador puede ser detenido (antes de que su " +"acción haya comenzado) al llamar al método :meth:`~Timer.cancel`. El " +"intervalo que el temporizador esperará antes de ejecutar su acción puede no " +"ser exactamente el mismo que el intervalo especificado por el usuario." #: ../Doc/library/threading.rst:922 msgid "For example::" -msgstr "" +msgstr "Por ejemplo:" #: ../Doc/library/threading.rst:933 msgid "" @@ -1191,16 +1696,24 @@ msgid "" "``None`` (the default) then an empty list will be used. If *kwargs* is " "``None`` (the default) then an empty dict will be used." msgstr "" +"Crear un temporizador que ejecutará *function* con los argumentos *args* y " +"los argumentos de palabra clave *kwargs*, luego de que una cantidad " +"*interval* de segundos hayan transcurrido. Si *args* es ``None`` (por " +"defecto) se utilizará una lista vacía. Si *kwargs* es ``None`` (por defecto) " +"se utilizará un *dict* vacío." #: ../Doc/library/threading.rst:943 msgid "" "Stop the timer, and cancel the execution of the timer's action. This will " "only work if the timer is still in its waiting stage." msgstr "" +"Detiene el temporizador, y cancela la ejecución de la acción del " +"temporizador. Esto sólo funcionará si el temporizador está en etapa de " +"espera." #: ../Doc/library/threading.rst:948 msgid "Barrier Objects" -msgstr "" +msgstr "Objetos de barrera" #: ../Doc/library/threading.rst:952 msgid "" @@ -1210,17 +1723,26 @@ msgid "" "will block until all of the threads have made their :meth:`~Barrier.wait` " "calls. At this point, the threads are released simultaneously." msgstr "" +"Esta clase provee un primitivo de sincronización simple para ser usado por " +"un número fijo de hilos que necesitan esperarse entre ellos. Cada uno de los " +"hilos intenta pasar la barrera llamando al método :meth:`~Barrier.wait` y " +"bloqueará hasta que todos los hilos hayan hecho sus respectivas llamadas a :" +"meth:`~Barrier.wait`. En este punto, los hilos son liberados simultáneamente." #: ../Doc/library/threading.rst:958 msgid "" "The barrier can be reused any number of times for the same number of threads." msgstr "" +"La barrera puede ser reutilizada cualquier número de veces para el mismo " +"número de hilos." #: ../Doc/library/threading.rst:960 msgid "" "As an example, here is a simple way to synchronize a client and server " "thread::" msgstr "" +"Como ejemplo, aquí hay una manera simple de sincronizar un hilo cliente con " +"uno servidor::" #: ../Doc/library/threading.rst:980 msgid "" @@ -1229,6 +1751,10 @@ msgid "" "released. *timeout* is the default timeout value if none is specified for " "the :meth:`wait` method." msgstr "" +"Crear un objeto de barrera para un número *parties* de hilos. Una *action*, " +"si es provista, es un invocable a ser llamado por uno de los hilos cuando " +"sean liberados. *timeout* es el valor de tiempo de espera máximo por defecto " +"si no se especifica uno en el método :meth:`wait`." #: ../Doc/library/threading.rst:987 msgid "" @@ -1237,6 +1763,10 @@ msgid "" "provided, it is used in preference to any that was supplied to the class " "constructor." msgstr "" +"Pasa la barrera. Cuando todos los hilos involucrados en el objeto barrera " +"han llamado esta función, se liberan todos simultáneamente. Si se provee un " +"valor *timeout*, se utilizará con preferencia sobre cualquiera que haya sido " +"suministrado al constructor de la clase." #: ../Doc/library/threading.rst:992 msgid "" @@ -1244,6 +1774,9 @@ msgid "" "for each thread. This can be used to select a thread to do some special " "housekeeping, e.g.::" msgstr "" +"El valor de retorno es un entero en el rango desde 0 hasta *parties* -- 1, " +"diferente para cada hilo. Puede ser utilizado para seleccionar a un hilo " +"para que haga alguna limpieza especial, por ejemplo::" #: ../Doc/library/threading.rst:1001 msgid "" @@ -1251,22 +1784,29 @@ msgid "" "called it prior to being released. Should this call raise an error, the " "barrier is put into the broken state." msgstr "" +"Se se provee una *action* al constructor, uno de los hilos la habrá llamado " +"antes de ser liberado. Si acaso esta llamada lanzara un error, la barrera " +"entra en estado *broken* (roto)." #: ../Doc/library/threading.rst:1005 msgid "If the call times out, the barrier is put into the broken state." -msgstr "" +msgstr "Si la llamada caduca, la barrera entra en estado *broken*." #: ../Doc/library/threading.rst:1007 msgid "" "This method may raise a :class:`BrokenBarrierError` exception if the barrier " "is broken or reset while a thread is waiting." msgstr "" +"Este método podría lanzar una excepción :class:`BrokenBarrierError` si la " +"barrera está rota o si se reinicia mientras el hilo está esperando." #: ../Doc/library/threading.rst:1012 msgid "" "Return the barrier to the default, empty state. Any threads waiting on it " "will receive the :class:`BrokenBarrierError` exception." msgstr "" +"Retorna la barrera al estado por defecto, vacío. Cualquier hilo que esté a " +"su espera recibirá la excepción :class:`BrokenBarrierError`." #: ../Doc/library/threading.rst:1015 msgid "" @@ -1274,6 +1814,9 @@ msgid "" "there are other threads whose state is unknown. If a barrier is broken it " "may be better to just leave it and create a new one." msgstr "" +"Nótese que utilizar esta función podría requerir alguna sincronización " +"externa si existen otros hilos cuyos estados sean desconocidos. Si una " +"barrera se rompe puede ser mejor abandonarla y crear una nueva." #: ../Doc/library/threading.rst:1021 msgid "" @@ -1282,35 +1825,45 @@ msgid "" "example if one of the threads needs to abort, to avoid deadlocking the " "application." msgstr "" +"Coloca la barrera en estado roto. Esto causa que cualquier llamada activa o " +"futura a :meth:`wait` falle con el error :class:`BrokenBarrierError`. Úsese " +"por ejemplo si uno de los hilos necesita abortar, para evitar que la " +"aplicación quede en punto muerto." #: ../Doc/library/threading.rst:1026 msgid "" "It may be preferable to simply create the barrier with a sensible *timeout* " "value to automatically guard against one of the threads going awry." msgstr "" +"Puede ser preferible simplemente crear la barrera con un valor *timeout* " +"sensato para cuidarse automáticamente de que uno de los hilos falle." #: ../Doc/library/threading.rst:1032 msgid "The number of threads required to pass the barrier." -msgstr "" +msgstr "El número de hilos requeridos para pasar la barrera." #: ../Doc/library/threading.rst:1036 msgid "The number of threads currently waiting in the barrier." -msgstr "" +msgstr "El número de hilos actualmente esperando en la barrera." #: ../Doc/library/threading.rst:1040 msgid "A boolean that is ``True`` if the barrier is in the broken state." msgstr "" +"Un valor booleano que será ``True`` si la barrera está en el estado roto." #: ../Doc/library/threading.rst:1045 msgid "" "This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:" "`Barrier` object is reset or broken." msgstr "" +"Esta excepción, una subclase de :exc:`RuntimeError`, se lanza cuando el " +"objeto :class:`Barrier` se restablece o se rompe." #: ../Doc/library/threading.rst:1052 msgid "" "Using locks, conditions, and semaphores in the :keyword:`!with` statement" msgstr "" +"Uso de *locks*, condiciones y semáforos en la declaración :keyword:`!with`" #: ../Doc/library/threading.rst:1054 msgid "" @@ -1320,10 +1873,15 @@ msgid "" "entered, and :meth:`release` will be called when the block is exited. " "Hence, the following snippet::" msgstr "" +"Todos los objetos provistos por este módulo que tienen métodos :meth:" +"`acquire` y :meth:`release` pueden ser utilizados como administradores de " +"contexto para una declaración :keyword:`with`. El método :meth:`acquire` " +"será llamado cuando se ingresa al bloque y el método :meth:`release` será " +"llamado cuando se abandona el bloque. De ahí que, el siguiente fragmento::" #: ../Doc/library/threading.rst:1063 msgid "is equivalent to::" -msgstr "" +msgstr "sea equivalente a::" #: ../Doc/library/threading.rst:1071 msgid "" @@ -1331,3 +1889,6 @@ msgid "" "`Semaphore`, and :class:`BoundedSemaphore` objects may be used as :keyword:" "`with` statement context managers." msgstr "" +"Actualmente, los objetos :class:`Lock`, :class:`RLock`, :class:`Condition`, :" +"class:`Semaphore`, y :class:`BoundedSemaphore` pueden ser utilizados como " +"gestores de contexto con declaraciones :keyword:`with`."