पायथन मल्टीप्रोसेसिंग का उपयोग करते हुए शर्मनाक समानांतर समस्याओं का समाधान


82

शर्मनाक समानांतर समस्याओं से निपटने के लिए मल्टीप्रोसेसिंग का उपयोग कैसे किया जाता है ?

आमतौर पर समानांतर समस्याओं में तीन मूल भाग होते हैं:

  1. इनपुट डेटा (एक फ़ाइल, डेटाबेस, टीसीपी कनेक्शन आदि से) पढ़ें
  2. इनपुट डेटा पर गणना चलाएं , जहां प्रत्येक गणना किसी अन्य गणना से स्वतंत्र है
  3. गणना के परिणाम लिखें (एक फ़ाइल, डेटाबेस, टीसीपी कनेक्शन, आदि के लिए)।

हम दो आयामों में कार्यक्रम को समानांतर कर सकते हैं:

  • भाग 2 कई कोर पर चल सकता है, क्योंकि प्रत्येक गणना स्वतंत्र है; प्रसंस्करण का क्रम मायने नहीं रखता।
  • प्रत्येक भाग स्वतंत्र रूप से चल सकता है। भाग 1 एक इनपुट कतार पर डेटा रख सकता है, भाग 2 इनपुट कतार से डेटा खींच सकता है और एक आउटपुट कतार पर परिणाम डाल सकता है, और भाग 3 आउटपुट कतार से परिणाम खींच सकता है और उन्हें लिख सकता है।

यह समवर्ती प्रोग्रामिंग में एक सबसे बुनियादी पैटर्न लगता है, लेकिन मैं अभी भी इसे हल करने की कोशिश में खो गया हूं, तो आइए एक उदाहरण के रूप में यह वर्णन करने के लिए कि यह मल्टीप्रोसेसिंग का उपयोग करके कैसे किया जाता है

यहाँ उदाहरण की समस्या है: इनपुट के रूप में पूर्णांक की पंक्तियों के साथ एक सीएसवी फ़ाइल को देखते हुए , उनकी रकम की गणना करें। समस्या को तीन भागों में अलग करें, जो सभी समानांतर में चल सकते हैं:

  1. इनपुट फ़ाइल को कच्चे डेटा में संसाधित करें (पूर्णांकों की सूची / पुनरावृत्तियों)
  2. समानांतर में, डेटा के योगों की गणना करें
  3. रकम का उत्पादन

नीचे पारंपरिक, एकल-प्रक्रिया बाध्य पायथन कार्यक्रम है जो इन तीन कार्यों को हल करता है:

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# basicsums.py
"""A program that reads integer values from a CSV file and writes out their
sums to another CSV file.
"""

import csv
import optparse
import sys

def make_cli_parser():
    """Make the command line interface parser."""
    usage = "\n\n".join(["python %prog INPUT_CSV OUTPUT_CSV",
            __doc__,
            """
ARGUMENTS:
    INPUT_CSV: an input CSV file with rows of numbers
    OUTPUT_CSV: an output file that will contain the sums\
"""])
    cli_parser = optparse.OptionParser(usage)
    return cli_parser


def parse_input_csv(csvfile):
    """Parses the input CSV and yields tuples with the index of the row
    as the first element, and the integers of the row as the second
    element.

    The index is zero-index based.

    :Parameters:
    - `csvfile`: a `csv.reader` instance

    """
    for i, row in enumerate(csvfile):
        row = [int(entry) for entry in row]
        yield i, row


def sum_rows(rows):
    """Yields a tuple with the index of each input list of integers
    as the first element, and the sum of the list of integers as the
    second element.

    The index is zero-index based.

    :Parameters:
    - `rows`: an iterable of tuples, with the index of the original row
      as the first element, and a list of integers as the second element

    """
    for i, row in rows:
        yield i, sum(row)


def write_results(csvfile, results):
    """Writes a series of results to an outfile, where the first column
    is the index of the original row of data, and the second column is
    the result of the calculation.

    The index is zero-index based.

    :Parameters:
    - `csvfile`: a `csv.writer` instance to which to write results
    - `results`: an iterable of tuples, with the index (zero-based) of
      the original row as the first element, and the calculated result
      from that row as the second element

    """
    for result_row in results:
        csvfile.writerow(result_row)


def main(argv):
    cli_parser = make_cli_parser()
    opts, args = cli_parser.parse_args(argv)
    if len(args) != 2:
        cli_parser.error("Please provide an input file and output file.")
    infile = open(args[0])
    in_csvfile = csv.reader(infile)
    outfile = open(args[1], 'w')
    out_csvfile = csv.writer(outfile)
    # gets an iterable of rows that's not yet evaluated
    input_rows = parse_input_csv(in_csvfile)
    # sends the rows iterable to sum_rows() for results iterable, but
    # still not evaluated
    result_rows = sum_rows(input_rows)
    # finally evaluation takes place as a chain in write_results()
    write_results(out_csvfile, result_rows)
    infile.close()
    outfile.close()


if __name__ == '__main__':
    main(sys.argv[1:])

चलो इस कार्यक्रम को लेते हैं और इसे ऊपर उल्लिखित तीन हिस्सों को समानांतर करने के लिए मल्टीप्रोसेसिंग का उपयोग करने के लिए फिर से लिखते हैं। नीचे इस नए, समानांतर कार्यक्रम का एक कंकाल है, जिसे टिप्पणियों में भागों को संबोधित करने के लिए दूर करने की आवश्यकता है:

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# multiproc_sums.py
"""A program that reads integer values from a CSV file and writes out their
sums to another CSV file, using multiple processes if desired.
"""

import csv
import multiprocessing
import optparse
import sys

NUM_PROCS = multiprocessing.cpu_count()

def make_cli_parser():
    """Make the command line interface parser."""
    usage = "\n\n".join(["python %prog INPUT_CSV OUTPUT_CSV",
            __doc__,
            """
ARGUMENTS:
    INPUT_CSV: an input CSV file with rows of numbers
    OUTPUT_CSV: an output file that will contain the sums\
"""])
    cli_parser = optparse.OptionParser(usage)
    cli_parser.add_option('-n', '--numprocs', type='int',
            default=NUM_PROCS,
            help="Number of processes to launch [DEFAULT: %default]")
    return cli_parser


def main(argv):
    cli_parser = make_cli_parser()
    opts, args = cli_parser.parse_args(argv)
    if len(args) != 2:
        cli_parser.error("Please provide an input file and output file.")
    infile = open(args[0])
    in_csvfile = csv.reader(infile)
    outfile = open(args[1], 'w')
    out_csvfile = csv.writer(outfile)

    # Parse the input file and add the parsed data to a queue for
    # processing, possibly chunking to decrease communication between
    # processes.

    # Process the parsed data as soon as any (chunks) appear on the
    # queue, using as many processes as allotted by the user
    # (opts.numprocs); place results on a queue for output.
    #
    # Terminate processes when the parser stops putting data in the
    # input queue.

    # Write the results to disk as soon as they appear on the output
    # queue.

    # Ensure all child processes have terminated.

    # Clean up files.
    infile.close()
    outfile.close()


if __name__ == '__main__':
    main(sys.argv[1:])

कोड के इन टुकड़ों के साथ-साथ कोड का एक और टुकड़ा जो परीक्षण उद्देश्यों के लिए उदाहरण CSV फ़ाइलों को उत्पन्न कर सकता है, जीथब पर पाया जा सकता है

मैं यहां किसी भी अंतर्दृष्टि की सराहना करता हूं कि आप इस समस्या को कैसे समझेंगे।


इस समस्या के बारे में सोचते समय मेरे पास कुछ प्रश्न हैं। किसी भी / सभी को संबोधित करने के लिए बोनस अंक:

  • क्या मेरे पास डेटा में पढ़ने और इसे कतार में रखने के लिए बाल प्रक्रियाएं होनी चाहिए, या जब तक सभी इनपुट नहीं पढ़ लिए जाते हैं, तब तक मुख्य प्रक्रिया इसे अवरुद्ध किए बिना कर सकती है?
  • इसी तरह, क्या मेरे पास संसाधित कतार से परिणाम लिखने के लिए एक बच्चे की प्रक्रिया होनी चाहिए, या सभी परिणामों की प्रतीक्षा किए बिना मुख्य प्रक्रिया ऐसा कर सकती है?
  • क्या मुझे योग कार्यों के लिए एक प्रक्रिया पूल का उपयोग करना चाहिए ?
    • यदि हाँ, तो इनपुट और आउटपुट प्रक्रियाओं को अवरुद्ध किए बिना, इनपुट कतार में आने वाले परिणामों को संसाधित करने के लिए इसे प्राप्त करने के लिए मैं पूल पर किस विधि से कॉल करूं? apply_async () ? map_async () ? imap () ? imap_unordered () ?
  • मान लीजिए कि हमें इनपुट और आउटपुट कतारों से बाहर निकलने की जरूरत नहीं है क्योंकि डेटा ने उन्हें दर्ज किया था, लेकिन जब तक सभी इनपुट को पार्स नहीं किया गया था तब तक इंतजार कर सकता था और सभी परिणामों की गणना की गई थी (उदाहरण के लिए, क्योंकि हम जानते हैं कि सभी इनपुट और आउटपुट सिस्टम मेमोरी में फिट होंगे)। क्या हमें एल्गोरिथ्म को किसी भी तरह से बदलना चाहिए (जैसे, I / O के साथ समवर्ती कोई प्रक्रिया नहीं चलाना)?

2
हाहा, आई लव इज़ शर्मनाक-समानांतर। मुझे आश्चर्य है कि यह पहली बार है जब मैंने यह शब्द सुना है, यह उस अवधारणा को संदर्भित करने का एक शानदार तरीका है।
टॉम नेयलैंड

जवाबों:


70

मेरे समाधान में एक अतिरिक्त घंटी और सीटी है, यह सुनिश्चित करने के लिए कि आउटपुट का क्रम इनपुट के आदेश के समान है। मैं मल्टीप्रोसेसिंग का उपयोग करता हूं। प्रक्रियाओं के बीच डेटा भेजने के लिए, स्टॉप संदेश भेजना ताकि प्रत्येक प्रक्रिया कतार की जाँच करना छोड़ दे। मुझे लगता है कि स्रोत में टिप्पणियों से यह स्पष्ट होना चाहिए कि क्या चल रहा है, लेकिन अगर मुझे पता नहीं है।

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# multiproc_sums.py
"""A program that reads integer values from a CSV file and writes out their
sums to another CSV file, using multiple processes if desired.
"""

import csv
import multiprocessing
import optparse
import sys

NUM_PROCS = multiprocessing.cpu_count()

def make_cli_parser():
    """Make the command line interface parser."""
    usage = "\n\n".join(["python %prog INPUT_CSV OUTPUT_CSV",
            __doc__,
            """
ARGUMENTS:
    INPUT_CSV: an input CSV file with rows of numbers
    OUTPUT_CSV: an output file that will contain the sums\
"""])
    cli_parser = optparse.OptionParser(usage)
    cli_parser.add_option('-n', '--numprocs', type='int',
            default=NUM_PROCS,
            help="Number of processes to launch [DEFAULT: %default]")
    return cli_parser

class CSVWorker(object):
    def __init__(self, numprocs, infile, outfile):
        self.numprocs = numprocs
        self.infile = open(infile)
        self.outfile = outfile
        self.in_csvfile = csv.reader(self.infile)
        self.inq = multiprocessing.Queue()
        self.outq = multiprocessing.Queue()

        self.pin = multiprocessing.Process(target=self.parse_input_csv, args=())
        self.pout = multiprocessing.Process(target=self.write_output_csv, args=())
        self.ps = [ multiprocessing.Process(target=self.sum_row, args=())
                        for i in range(self.numprocs)]

        self.pin.start()
        self.pout.start()
        for p in self.ps:
            p.start()

        self.pin.join()
        i = 0
        for p in self.ps:
            p.join()
            print "Done", i
            i += 1

        self.pout.join()
        self.infile.close()

    def parse_input_csv(self):
            """Parses the input CSV and yields tuples with the index of the row
            as the first element, and the integers of the row as the second
            element.

            The index is zero-index based.

            The data is then sent over inqueue for the workers to do their
            thing.  At the end the input process sends a 'STOP' message for each
            worker.
            """
            for i, row in enumerate(self.in_csvfile):
                row = [ int(entry) for entry in row ]
                self.inq.put( (i, row) )

            for i in range(self.numprocs):
                self.inq.put("STOP")

    def sum_row(self):
        """
        Workers. Consume inq and produce answers on outq
        """
        tot = 0
        for i, row in iter(self.inq.get, "STOP"):
                self.outq.put( (i, sum(row)) )
        self.outq.put("STOP")

    def write_output_csv(self):
        """
        Open outgoing csv file then start reading outq for answers
        Since I chose to make sure output was synchronized to the input there
        is some extra goodies to do that.

        Obviously your input has the original row number so this is not
        required.
        """
        cur = 0
        stop = 0
        buffer = {}
        # For some reason csv.writer works badly across processes so open/close
        # and use it all in the same process or else you'll have the last
        # several rows missing
        outfile = open(self.outfile, "w")
        self.out_csvfile = csv.writer(outfile)

        #Keep running until we see numprocs STOP messages
        for works in range(self.numprocs):
            for i, val in iter(self.outq.get, "STOP"):
                # verify rows are in order, if not save in buffer
                if i != cur:
                    buffer[i] = val
                else:
                    #if yes are write it out and make sure no waiting rows exist
                    self.out_csvfile.writerow( [i, val] )
                    cur += 1
                    while cur in buffer:
                        self.out_csvfile.writerow([ cur, buffer[cur] ])
                        del buffer[cur]
                        cur += 1

        outfile.close()

def main(argv):
    cli_parser = make_cli_parser()
    opts, args = cli_parser.parse_args(argv)
    if len(args) != 2:
        cli_parser.error("Please provide an input file and output file.")

    c = CSVWorker(opts.numprocs, args[0], args[1])

if __name__ == '__main__':
    main(sys.argv[1:])

1
यह एकमात्र उत्तर है जो वास्तव में उपयोग किया जाता है multiprocessing। इनाम आपके पास जाता है, सर।
गत 16

1
क्या वास्तव joinमें इनपुट और नंबर-क्रंचिंग प्रक्रियाओं पर कॉल करना आवश्यक है? क्या आप केवल आउटपुट प्रक्रिया में शामिल होने और दूसरों की अनदेखी करने से दूर नहीं हो सकते थे? यदि हां, तो joinक्या अन्य सभी प्रक्रियाओं पर कॉल करने का एक अच्छा कारण है?
रयान सी। थॉम्पसन

"इसलिए थ्रेड्स को छोड़ना जानते हैं" - "थ्रेड्स के बीच डेटा भेजें" - थ्रेड्स और प्रोसेस बहुत अलग हैं। मैं देख रहा हूं कि यह नौसिखियों को भ्रमित कर सकता है। एक उत्तर में सही शब्दावली का उपयोग करने के लिए जितना अधिक महत्वपूर्ण है, उतने को उखाड़ा गया है। आप यहां नई प्रक्रियाएं शुरू कर रहे हैं। आप वर्तमान प्रक्रिया के भीतर केवल थ्रेडिंग नहीं कर रहे हैं।
डॉ। जन-फिलिप गेर्के

काफी उचित। मैंने पाठ ठीक कर लिया है।
hbar

शानदार जवाब। बहुत बहुत धन्यवाद।
अंडाणु

7

पार्टी में देर से आना ...

जॉबलीब में छोरों के समानांतर बनाने में मदद करने के लिए मल्टीप्रोसेसिंग के ऊपर एक परत होती है। यह आपको नौकरियों की एक आलसी प्रेषण, और इसके बहुत ही सरल वाक्यविन्यास के अलावा बेहतर त्रुटि रिपोर्टिंग जैसी सुविधाएं देता है।

अस्वीकरण के रूप में, मैं जॉबलिब का मूल लेखक हूं।


3
तो क्या जॉर्लिब समानांतर में I / O को संभालने में सक्षम है या आपको हाथ से ऐसा करना है? क्या आप Joblib का उपयोग करके एक कोड नमूना प्रदान कर सकते हैं? धन्यवाद!
रोको मिजिक

5

मुझे लगता है कि मैं पार्टी के लिए थोड़ा लेट हो गया हूं, लेकिन मैंने हाल ही में जीएनयू को समानांतर रूप से खोजा है , और यह दिखाना चाहता हूं कि इसके साथ इस विशिष्ट कार्य को पूरा करना कितना आसान है।

cat input.csv | parallel ./sum.py --pipe > sums

कुछ इस तरह के लिए करेंगे sum.py:

#!/usr/bin/python

from sys import argv

if __name__ == '__main__':
    row = argv[-1]
    values = (int(value) for value in row.split(','))
    print row, ':', sum(values)

समानांतर (निश्चित रूप से, समानांतर में) sum.pyहर पंक्ति के लिए चलेगा input.csv, फिर परिणामों को आउटपुट करेगा sums। स्पष्ट रूप से multiprocessingपरेशानी से बेहतर है


3
जीएनयू समानांतर डॉक्स इनपुट फ़ाइल में प्रत्येक पंक्ति के लिए एक नया पायथन दुभाषिया आह्वान करेगा। एक नया पायथन इंटरप्रिटर (पायथन 2.7 के लिए लगभग 30 मिलीसेकंड और पायथन 3.3 के लिए 40 मिलीसेकंड मेरे i7 मैकबुक प्रो पर एक ठोस राज्य ड्राइव के साथ शुरू करने में ओवरहेड) डेटा की एक व्यक्तिगत रेखा को संसाधित करने और लीड करने में लगने वाले समय को काफी कम कर सकता है। बहुत समय बर्बाद और उम्मीद से अधिक गरीब लाभ। आपके उदाहरण की समस्या के मामले में, मैं शायद मल्टीप्रोसेसिंग के लिए पहुंचूंगा
16

4

पुराना स्कूल।

p1.py

import csv
import pickle
import sys

with open( "someFile", "rb" ) as source:
    rdr = csv.reader( source )
    for line in eumerate( rdr ):
        pickle.dump( line, sys.stdout )

p2.py

import pickle
import sys

while True:
    try:
        i, row = pickle.load( sys.stdin )
    except EOFError:
        break
    pickle.dump( i, sum(row) )

p3.py

import pickle
import sys
while True:
    try:
        i, row = pickle.load( sys.stdin )
    except EOFError:
        break
    print i, row

यहां मल्टी-प्रोसेसिंग फाइनल स्ट्रक्चर है।

python p1.py | python p2.py | python p3.py

हां, शेल ने ओएस स्तर पर इन्हें एक साथ बुना हुआ है। यह मुझे सरल लगता है और यह बहुत अच्छी तरह से काम करता है।

हां, अचार (या cPickle) का उपयोग करने में थोड़ा अधिक ओवरहेड है। सरलीकरण, हालांकि, प्रयास के लायक लगता है।

यदि आप चाहते हैं कि फ़ाइल नाम एक तर्क हो p1.py, तो यह एक आसान बदलाव है।

इससे भी महत्वपूर्ण बात, निम्नलिखित की तरह एक समारोह बहुत काम है।

def get_stdin():
    while True:
        try:
            yield pickle.load( sys.stdin )
        except EOFError:
            return

यह आपको ऐसा करने की अनुमति देता है:

for item in get_stdin():
     process item

यह बहुत सरल है, लेकिन यह आपको आसानी से P2.py की कई प्रतियाँ चलाने की अनुमति नहीं देता है।

आपकी दो समस्याएं हैं: फैन-आउट और फैन-इन। P1.py किसी न किसी तरह से कई P2.py है। और पी 2 जीडीपी को किसी भी तरह से अपने परिणामों को एक ही पी 3 डीएमआर में मर्ज करना होगा।

फैन-आउट के लिए पुराने स्कूल का दृष्टिकोण "पुश" वास्तुकला है, जो बहुत प्रभावी है।

सैद्धांतिक रूप से, एक सामान्य कतार से कई पी 2 थिंकपैड खींचना संसाधनों का इष्टतम आवंटन है। यह अक्सर आदर्श होता है, लेकिन यह उचित मात्रा में प्रोग्रामिंग भी है। क्या प्रोग्रामिंग वास्तव में आवश्यक है? या राउंड-रॉबिन प्रसंस्करण काफी अच्छा होगा?

व्यावहारिक रूप से, आप पाएंगे कि P1.py एक साधारण "राउंड रॉबिन" बना रहा है जो कई P2.py के बीच काम कर रहा है। आपके पास P1.py नाम पाइप के माध्यम से P2.py की n प्रतियों से निपटने के लिए कॉन्फ़िगर किया गया है। पी 2 जीडीपी प्रत्येक अपने उपयुक्त पाइप से पढ़ेगा।

क्या होगा अगर एक पी 2 थिंकपैड सभी "सबसे खराब स्थिति" डेटा प्राप्त करता है और पीछे चलता है? हां, राउंड-रॉबिन सही नहीं है। लेकिन यह केवल एक पी 2 ओ के लिए बेहतर है और आप सरल यादृच्छिकरण के साथ इस पूर्वाग्रह को संबोधित कर सकते हैं।

कई पी 2 डी में से एक पी 3 एएमडी तक फैन-इन थोड़ा अधिक जटिल है, फिर भी। इस बिंदु पर, पुराने स्कूल का दृष्टिकोण लाभप्रद होना बंद हो जाता है। P3.py को रीडर्स इंटरलेव करने के लिए selectलाइब्रेरी का उपयोग करके कई नामित पाइपों से पढ़ना होगा ।


जब मैं np2.py के उदाहरणों को लॉन्च करना चाहता हूं, तो क्या यह बालों को नहीं मिलेगा , क्या उन्होंने p1.py द्वारा पंक्तियों के आउटपुट mका उपभोग और प्रसंस्करण rकिया है, और क्या p3.py ने सभी p2.py उदाहरणों से mx rपरिणाम प्राप्त nकिए हैं?
22

1
मैंने उस आवश्यकता को प्रश्न में नहीं देखा। (शायद यह सवाल बहुत लंबा और जटिल था कि उस आवश्यकता को पूरा करने के लिए।) क्या महत्वपूर्ण है कि आपके पास यह अपेक्षा करने के लिए बहुत अच्छा कारण होना चाहिए कि एकाधिक P2 वास्तव में आपकी प्रदर्शन समस्या को हल करते हैं। हालांकि हम इस बात की परिकल्पना कर सकते हैं कि ऐसी स्थिति मौजूद हो सकती है, * निक्स वास्तुकला में ऐसा कभी नहीं हुआ है और कोई भी इसे जोड़ने के लिए फिट नहीं देखा गया है। यह कई p2 है उपयोगी हो सकता है। लेकिन पिछले 40 वर्षों से, किसी को भी शेल के प्रथम श्रेणी का हिस्सा बनाने के लिए पर्याप्त आवश्यकता नहीं देखी गई है।
S.Lott

फिर मेरी गलती है। मुझे उस बिंदु को संपादित करने और स्पष्ट करने दें। प्रश्न को बेहतर बनाने में मेरी मदद करने के लिए, भ्रम की स्थिति क्या है sum()? यह उदाहरण के लिए है। मैं इसे बदल सकता do_something()था, लेकिन मैं एक ठोस, उदाहरण समझना आसान (पहला वाक्य देखें) चाहता था। वास्तव में, मेरा do_something()बहुत सीपीयू गहन है, लेकिन प्रत्येक कॉल स्वतंत्र होने के बाद, शर्मनाक ढंग से समानांतर होने योग्य है। इसलिए, इस पर कई कोर चबाने में मदद मिलेगी।
गृहनगर

"क्या योग राशि () के उपयोग से भ्रम होता है?" स्पष्ट रूप से नहीं। मुझे यकीन नहीं है कि आप इसका उल्लेख क्यों करेंगे। आपने कहा था: "जब मैं p2.py के n इंस्टेंसेस को लॉन्च करना चाहता हूँ तो इससे बाल नहीं कटेंगे"। मैंने उस आवश्यकता को प्रश्न में नहीं देखा।
एस.लॉट

0

यह संभव है कि भाग 1 में भी थोड़ा समानता का परिचय दिया जाए। संभवतः CSV के प्रारूप जितना आसान नहीं है, लेकिन अगर इनपुट डेटा की प्रोसेसिंग डेटा की रीडिंग की तुलना में काफी धीमी है, तो आप बड़े विखंडू पढ़ सकते हैं, तब तक पढ़ना जारी रखें, जब तक आपको "पंक्ति विभाजक" नहीं मिल जाता है CSV मामले में नई रूपरेखा, लेकिन फिर से जो प्रारूप रीड पर निर्भर करता है, यदि प्रारूप पर्याप्त रूप से जटिल है तो काम नहीं करता है)।

ये विखंडू, जिनमें से प्रत्येक में संभवतः कई प्रविष्टियाँ होती हैं, को समानांतर प्रक्रियाओं की एक भीड़ से दूर किया जा सकता है, जहाँ वे कतारबद्ध और विभाजित होते हैं, फिर चरण 2 के लिए कतार में रखे जाते हैं।

हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.