Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7874963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:54:16+00:00 2026-06-03T02:54:16+00:00

I am writing a sample program to test the usage of multiprocessing pool of

  • 0

I am writing a sample program to test the usage of multiprocessing pool of workers in python 2.7.2+

This is the code i have written in the python ubuntu interpreter

>>> from multiprocessing import Pool
>>> def name_append(first_name,last_name):
...     return first_name+" "+last_name
...

>>> from functools import partial
>>> partial_name_append=partial(name_append,'kiran')
>>> partial_name_append('acb')
'kiran acb'
>>> abc='kiran'

>>> pool=Pool(processes=4)
>>> pool.map(partial_name_append,abc)
['kiran k', 'kiran i', 'kiran r', 'kiran a', 'kiran n']
>>> pool.close()
>>> pool.join()

>>> pool.map(partial_name_append,abc)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 226, in map
    assert self._state == RUN
AssertionError

After i got pickle errors, over my pool of workers code for large data sets, i am trying to do small examples and try to figure out what is the error.

I dont understand why the same statement ‘pool.map’ doesn’t work, when it has worked above. I think i have executed the ‘pool map’ correctly but i dont understand the reason.

Is this error related to “PicklingError: Can’t pickle : attribute lookup builtin.function failed”

Can someone help me out ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:54:17+00:00Added an answer on June 3, 2026 at 2:54 am

    You typed:

    >>> pool.close()
    

    from the docs:

    close()

    Prevents any more tasks from being submitted to the pool. Once all the tasks
    have been completed the worker processes will exit.

    Of course you can’t use the pool anymore, you closed it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a simple test of embedding Lua into a C program. I have
I'm writing a simple test program to pass multidimensional arrays. I've been struggling to
So I was writing this simple program to calculate the day of any date
I am writing a simple keylogger program (for non-malicious purposes). Note: This is with
I have a completely non-interactive python program that takes some command-line options and input
I was writing a simple genetic program to test out the process, but got
Note: this appears to have been fixed in Roslyn This question arose when writing
im writing a sample SDL program, and I just wrote the simplest program, but
Basically I am writing a simple program using the boost socket library... I have
Here is my minimal example: program test implicit none real :: testfunc write(*,*) Writing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.