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

  • Home
  • SEARCH
  • 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 6970719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:44:46+00:00 2026-05-27T16:44:46+00:00

I recently want to develop a HTTP server frontier to wrap my ipcontroller/ipengine clustering

  • 0

I recently want to develop a HTTP server frontier to wrap my ipcontroller/ipengine clustering program. The server is a simple derived from BaseHTTPServer. When the server receives a HTTP Get request, its do_GET method will call several mec.execute() method to finish the job. Here is the code sample.

do_GET
{
b = parameter
mec.scatter("a", b)
mec.execute("c=fun(a)")
d = mec.gather("c")
write d
}

Will I face Synchronization problem at the statement mec.execute(“c=fun(a)”)? From my guessing, a variable “c” will be created at each ipengie with value “fun(a)”. If two threads call do_Get method simultaneously with different parameter, what will be the value of “c” at each of ipengine.

  • 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-05-27T16:44:46+00:00Added an answer on May 27, 2026 at 4:44 pm

    If you can express the task as single parallel function call, then you should be safe, because no other requests can sneak in between (and engine globals need not be touched), e.g:

    from IPython import parallel
    
    rc = parallel.Client()
    view = rc[:]
    
    @view.parallel(block=True)
    def pfun(a):
        """each engine will get a chunk of a, not the whole thing"""
        c = fun(a)
        return c
    
    # a will be scattered and c will be gathered
    c = pfun(a)
    

    But if not, then the easiest solution is probably to ensure that you don’t have name collisions across jobs by giving your variables for a given request a unique suffix with a UUID:

    import uuid
    suffix = str(uuid.uuid4()).replace('-','') # remove '-' so we have a valid identifier
    a_name = "a_" + suffix
    c_name = "c_" + suffix
    mec.scatter(a_name, b)
    mec.execute("%s = fun(%s)" % (c_name, a_name))
    d = mec.gather(c_name)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently i start develop a setup program using asp.net , I want to save
I've recently learned core Java and want to develop my skills further with practice
I want to retrieve the most recently added record from CoreData. I was wondering
Recently we migrated from VSS to SVN. But I don't want VSS removed totally,
I recently downloaded an event calendar from this link: http://www.asp.net/downloads/starter-kits/club/EventCalendar.zip I want to use
I'm recently want to develop an application for my company. I've checked the Silverlight
everybody Recently I have use ADT to develop the android 2.2 program. The program
I have started to program in Java SE recently, and I noticed from many
I want to retrieve the recently viewed pictures from IE. I know that all
Recently I'm programming a website and I want to prevent my source code from

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.