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 9182425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:33:28+00:00 2026-06-17T18:33:28+00:00

On a server I have a C++ program which takes some input and writes

  • 0

On a server I have a C++ program which takes some input and writes some output to a file. After the file is generated, I want to send an email to a person with the corresponding link to the file.

I’d rather avoid dealing with SMTP from C++ itself, so I thought about having C++ using a system call to execute a python script, which would in turn handle the emailing process.

In C++:

system("python emailer.py foo@bar.com filetodownload.txt");

In Python:

import sys
email = sys.argv[1]
file = sys.argv[2]
// handle SMTP emailing...

I have a question about this simple approach. The C++ program is multithreaded, so there may be more than one thread wanting to call the python script to send an email. Is this a concern? Would one (again simple) solution be having a mutex variable in the C++ program which allows only one thread to call the python script at a time? Also, if there are better ways to go about accomplishing this task please let me know.

  • 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-17T18:33:29+00:00Added an answer on June 17, 2026 at 6:33 pm

    From what you’ve shown I don’t see any shared resource that would require any multi-threaded synchronisation. Each system call to python will result in a separate process.

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

Sidebar

Related Questions

I have a server program which should run full time a day. If I
I have a program app1 which launches another application using: app2Server := CreateOleObject('app2.Server'); On
I have created a program which allows me to upload images to my server.
I have a java program which sends a udp packet to a server when
I have a program that downloads PCM data from a Web Server, which it
I have a program to send POST request to a server. I'm using cURL
I have a simple Ruby program which takes the command line arguments and posts
i am developing a client/server program in which i want to invoke a method
I have a C# program I'm writing which interacts with SQL Server. I had
I have a 'server' program that updates many linked lists in shared memory in

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.