@@ -2286,16 +2286,24 @@ msgid ""
22862286"method is set to ``None``. If *method* is ``None`` and *force* is ``False`` "
22872287"then the context is set to the default context."
22882288msgstr ""
2289+ "Define o método que deve ser usado para iniciar processos filho. O argumento "
2290+ "*method* pode ser ``'fork'``, ``'spawn'`` ou ``'forkserver'``. Levanta :exc:"
2291+ "`RuntimeError` se o método de início já tiver sido definido e *force* não "
2292+ "for ``True``. Se *method* for ``None`` e *force* for ``True``, o método de "
2293+ "início será definido como ``None``. Se *method* for ``None`` e *force* for "
2294+ "``False``, o contexto será definido como o contexto padrão."
22892295
22902296#: ../../library/multiprocessing.rst:1150
22912297msgid ""
22922298"Note that this should be called at most once, and it should be protected "
22932299"inside the ``if __name__ == '__main__'`` clause of the main module."
22942300msgstr ""
2301+ "Observe que isso deve ser chamado no máximo uma vez e deve ser protegido "
2302+ "dentro da cláusula ``if __name__ == '__main__'`` do módulo principal."
22952303
22962304#: ../../library/multiprocessing.rst:1154
22972305msgid "See :ref:`multiprocessing-start-methods`."
2298- msgstr ""
2306+ msgstr "Veja :ref:`multiprocessing-start-methods`. "
22992307
23002308#: ../../library/multiprocessing.rst:1160
23012309msgid ""
@@ -2304,74 +2312,100 @@ msgid ""
23042312"func:`threading.setprofile`, :class:`threading.Timer`, or :class:`threading."
23052313"local`."
23062314msgstr ""
2315+ ":mod:`multiprocessing` contém nenhum análogo de :func:`threading."
2316+ "active_count`, :func:`threading.enumerate`, :func:`threading.settrace`, :"
2317+ "func:`threading.setprofile`, :class:`threading.Timer` ou :class:`threading."
2318+ "local`."
23072319
23082320#: ../../library/multiprocessing.rst:1167
23092321msgid "Connection Objects"
2310- msgstr ""
2322+ msgstr "Objetos de conexão "
23112323
23122324#: ../../library/multiprocessing.rst:1171
23132325msgid ""
23142326"Connection objects allow the sending and receiving of picklable objects or "
23152327"strings. They can be thought of as message oriented connected sockets."
23162328msgstr ""
2329+ "Objetos de conexão permitem o envio e recebimento de strings e objetos que "
2330+ "podem ser serializados com pickle. Eles podem ser pensados como sockets "
2331+ "conectados orientados a mensagens."
23172332
23182333#: ../../library/multiprocessing.rst:1174
23192334msgid ""
23202335"Connection objects are usually created using :func:`Pipe <multiprocessing."
23212336"Pipe>` -- see also :ref:`multiprocessing-listeners-clients`."
23222337msgstr ""
2338+ "Objetos de conexão geralmente são criados usando :func:`Pipe "
2339+ "<multiprocessing.Pipe>` -- veja também :ref:`multiprocessing-listeners-"
2340+ "clients`."
23232341
23242342#: ../../library/multiprocessing.rst:1182
23252343msgid ""
23262344"Send an object to the other end of the connection which should be read "
23272345"using :meth:`recv`."
23282346msgstr ""
2347+ "Envia um objeto para a outra extremidade da conexão que deve ser lido "
2348+ "usando :meth:`recv`."
23292349
23302350#: ../../library/multiprocessing.rst:1185
23312351msgid ""
23322352"The object must be picklable. Very large pickles (approximately 32 MiB+, "
23332353"though it depends on the OS) may raise a :exc:`ValueError` exception."
23342354msgstr ""
2355+ "O objeto deve poder ser serializado com pickle. Serializações muito grandes "
2356+ "com pickles (aproximadamente 32 MiB+, embora isso dependa do sistema "
2357+ "operacional) podem levantar uma exceção :exc:`ValueError`."
23352358
23362359#: ../../library/multiprocessing.rst:1190
23372360msgid ""
23382361"Return an object sent from the other end of the connection using :meth:"
23392362"`send`. Blocks until there is something to receive. Raises :exc:`EOFError` "
23402363"if there is nothing left to receive and the other end was closed."
23412364msgstr ""
2365+ "Retorna um objeto enviado a partir da outra extremidade da conexão usando :"
2366+ "meth:`send`. Bloqueia até que haja algo para receber. Levanta :exc:"
2367+ "`EOFError` se não houver mais nada para receber e a outra extremidade tenha "
2368+ "sido fechada."
23422369
23432370#: ../../library/multiprocessing.rst:1197
23442371msgid "Return the file descriptor or handle used by the connection."
2345- msgstr ""
2372+ msgstr "Retorna o descritor de arquivo ou identificador usado pela conexão. "
23462373
23472374#: ../../library/multiprocessing.rst:1201
23482375msgid "Close the connection."
2349- msgstr ""
2376+ msgstr "Fecha a conexão. "
23502377
23512378#: ../../library/multiprocessing.rst:1203
23522379msgid "This is called automatically when the connection is garbage collected."
2353- msgstr ""
2380+ msgstr "Isso é chamado automaticamente quando a conexão é coletada como lixo. "
23542381
23552382#: ../../library/multiprocessing.rst:1207
23562383msgid "Return whether there is any data available to be read."
2357- msgstr ""
2384+ msgstr "Retorna se há algum dado disponível para leitura. "
23582385
23592386#: ../../library/multiprocessing.rst:1209
23602387msgid ""
23612388"If *timeout* is not specified then it will return immediately. If *timeout* "
23622389"is a number then this specifies the maximum time in seconds to block. If "
23632390"*timeout* is ``None`` then an infinite timeout is used."
23642391msgstr ""
2392+ "Se *timeout* não for especificado, ele retornará imediatamente. Se *timeout* "
2393+ "for um número, isso especificará o tempo máximo em segundos para bloquear. "
2394+ "Se *timeout* for ``None``, um tempo limite infinito será usado."
23652395
23662396#: ../../library/multiprocessing.rst:1213
23672397msgid ""
23682398"Note that multiple connection objects may be polled at once by using :func:"
23692399"`multiprocessing.connection.wait`."
23702400msgstr ""
2401+ "Observe que vários objetos de conexão podem ser pesquisados ao mesmo tempo "
2402+ "usando :func:`multiprocessing.connection.wait`."
23712403
23722404#: ../../library/multiprocessing.rst:1218
23732405msgid "Send byte data from a :term:`bytes-like object` as a complete message."
23742406msgstr ""
2407+ "Enviar dados de bytes de um :term:`objeto byte ou similar` como uma mensagem "
2408+ "completa."
23752409
23762410#: ../../library/multiprocessing.rst:1220
23772411msgid ""
@@ -2380,6 +2414,10 @@ msgid ""
23802414"buffers (approximately 32 MiB+, though it depends on the OS) may raise a :"
23812415"exc:`ValueError` exception"
23822416msgstr ""
2417+ "Se *offset* for fornecido, os dados serão lidos daquela posição em *buffer*. "
2418+ "Se *size* for fornecido, essa quantidade de bytes será lida do buffer. "
2419+ "Buffers muito grandes (aproximadamente 32 MiB+, embora isso dependa do "
2420+ "sistema operacional) podem levantar uma exceção :exc:`ValueError`"
23832421
23842422#: ../../library/multiprocessing.rst:1227
23852423msgid ""
@@ -2388,18 +2426,26 @@ msgid ""
23882426"exc:`EOFError` if there is nothing left to receive and the other end has "
23892427"closed."
23902428msgstr ""
2429+ "Retorna uma mensagem completa de dados como bytes enviados a partir da outra "
2430+ "extremidade da conexão como uma string. Bloqueia até que haja algo para "
2431+ "receber. Levanta :exc:`EOFError` se não houver mais nada para receber e a "
2432+ "outra extremidade tenha sido fechada."
23912433
23922434#: ../../library/multiprocessing.rst:1232
23932435msgid ""
23942436"If *maxlength* is specified and the message is longer than *maxlength* then :"
23952437"exc:`OSError` is raised and the connection will no longer be readable."
23962438msgstr ""
2439+ "Se *maxlength* for especificado e a mensagem for maior que *maxlength*, :exc:"
2440+ "`OSError` será levantada e a conexão não será mais legível."
23972441
23982442#: ../../library/multiprocessing.rst:1236
23992443msgid ""
24002444"This function used to raise :exc:`IOError`, which is now an alias of :exc:"
24012445"`OSError`."
24022446msgstr ""
2447+ "Esta função costumava levantada :exc:`IOError`, que agora é um apelido de :"
2448+ "exc:`OSError`."
24032449
24042450#: ../../library/multiprocessing.rst:1243
24052451msgid ""
@@ -2408,33 +2454,50 @@ msgid ""
24082454"until there is something to receive. Raises :exc:`EOFError` if there is "
24092455"nothing left to receive and the other end was closed."
24102456msgstr ""
2457+ "Lê para *buffer* uma mensagem completa de dados como bytes enviados a partir "
2458+ "da outra extremidade da conexão e retorna o número de bytes na mensagem. "
2459+ "Bloqueia até que haja algo para receber. Levanta :exc:`EOFError` se não "
2460+ "houver mais nada para receber e a outra extremidade tenha sido fechada."
24112461
24122462#: ../../library/multiprocessing.rst:1249
24132463msgid ""
24142464"*buffer* must be a writable :term:`bytes-like object`. If *offset* is given "
24152465"then the message will be written into the buffer from that position. Offset "
24162466"must be a non-negative integer less than the length of *buffer* (in bytes)."
24172467msgstr ""
2468+ "*buffer* deve ser um :term:`objeto byte ou similar` gravável. Se *offset* "
2469+ "for fornecido, a mensagem será escrita no buffer a partir dessa posição. A "
2470+ "posição deve ser um inteiro não negativo menor que o comprimento de *buffer* "
2471+ "(em bytes)."
24182472
24192473#: ../../library/multiprocessing.rst:1254
24202474msgid ""
24212475"If the buffer is too short then a :exc:`BufferTooShort` exception is raised "
24222476"and the complete message is available as ``e.args[0]`` where ``e`` is the "
24232477"exception instance."
24242478msgstr ""
2479+ "Se o buffer for muito curto, uma exceção :exc:`BufferTooShort` será "
2480+ "levantada e a mensagem completa estará disponível como ``e.args[0]``, onde "
2481+ "``e`` é a instância da exceção."
24252482
24262483#: ../../library/multiprocessing.rst:1258
24272484msgid ""
24282485"Connection objects themselves can now be transferred between processes "
24292486"using :meth:`Connection.send` and :meth:`Connection.recv`."
24302487msgstr ""
2488+ "Os próprios objetos de conexão agora podem ser transferidos entre processos "
2489+ "usando :meth:`Connection.send` e :meth:`Connection.recv`."
24312490
24322491#: ../../library/multiprocessing.rst:1262
24332492msgid ""
24342493"Connection objects also now support the context management protocol -- see :"
24352494"ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the "
24362495"connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`."
24372496msgstr ""
2497+ "Objetos de conexão agora também oferecem suporte ao protocolo de "
2498+ "gerenciamento de contexto — veja :ref:`typecontextmanager`. :meth:"
2499+ "`~contextmanager.__enter__` retorna o objeto de conexão, e :meth:"
2500+ "`~contextmanager.__exit__` chama :meth:`close`."
24382501
24392502#: ../../library/multiprocessing.rst:1266
24402503msgid "For example:"
@@ -2459,13 +2522,32 @@ msgid ""
24592522">>> arr2\n"
24602523"array('i', [0, 1, 2, 3, 4, 0, 0, 0, 0, 0])"
24612524msgstr ""
2525+ ">>> from multiprocessing import Pipe\n"
2526+ ">>> a, b = Pipe()\n"
2527+ ">>> a.send([1, 'hello', None])\n"
2528+ ">>> b.recv()\n"
2529+ "[1, 'hello', None]\n"
2530+ ">>> b.send_bytes(b'thank you')\n"
2531+ ">>> a.recv_bytes()\n"
2532+ "b'thank you'\n"
2533+ ">>> import array\n"
2534+ ">>> arr1 = array.array('i', range(5))\n"
2535+ ">>> arr2 = array.array('i', [0] * 10)\n"
2536+ ">>> a.send_bytes(arr1)\n"
2537+ ">>> count = b.recv_bytes_into(arr2)\n"
2538+ ">>> assert count == len(arr1) * arr1.itemsize\n"
2539+ ">>> arr2\n"
2540+ "array('i', [0, 1, 2, 3, 4, 0, 0, 0, 0, 0])"
24622541
24632542#: ../../library/multiprocessing.rst:1291
24642543msgid ""
24652544"The :meth:`Connection.recv` method automatically unpickles the data it "
24662545"receives, which can be a security risk unless you can trust the process "
24672546"which sent the message."
24682547msgstr ""
2548+ "O método :meth:`Connection.recv` deserializa com picke automaticamente os "
2549+ "dados recebidos, o que pode ser um risco à segurança, a menos que você possa "
2550+ "confiar no processo que enviou a mensagem."
24692551
24702552#: ../../library/multiprocessing.rst:1295
24712553msgid ""
@@ -2474,24 +2556,35 @@ msgid ""
24742556"methods after performing some sort of authentication. See :ref:"
24752557"`multiprocessing-auth-keys`."
24762558msgstr ""
2559+ "Portanto, a menos que o objeto de conexão tenha sido produzido usando :func:"
2560+ "`Pipe`, você deve usar apenas os métodos :meth:`~Connection.recv` e :meth:"
2561+ "`~Connection.send` após executar algum tipo de autenticação. Veja :ref:"
2562+ "`multiprocessing-auth-keys`."
24772563
24782564#: ../../library/multiprocessing.rst:1302
24792565msgid ""
24802566"If a process is killed while it is trying to read or write to a pipe then "
24812567"the data in the pipe is likely to become corrupted, because it may become "
24822568"impossible to be sure where the message boundaries lie."
24832569msgstr ""
2570+ "Se um processo for encerrado enquanto estiver tentando ler ou escrever em um "
2571+ "encadeamento, os dados no encadeameto provavelmente serão corrompidos, "
2572+ "porque pode se tornar impossível ter certeza de onde estão os limites do "
2573+ "encadeamento da mensagem."
24842574
24852575#: ../../library/multiprocessing.rst:1308
24862576msgid "Synchronization primitives"
2487- msgstr ""
2577+ msgstr "Primitivas de sincronização "
24882578
24892579#: ../../library/multiprocessing.rst:1312
24902580msgid ""
24912581"Generally synchronization primitives are not as necessary in a multiprocess "
24922582"program as they are in a multithreaded program. See the documentation for :"
24932583"mod:`threading` module."
24942584msgstr ""
2585+ "Geralmente, primitivas de sincronização não são tão necessárias em um "
2586+ "programa multiprocesso quanto em um programa multithread. Veja a "
2587+ "documentação do módulo :mod:`threading`."
24952588
24962589#: ../../library/multiprocessing.rst:1316
24972590msgid ""
0 commit comments