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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:19:20+00:00 2026-06-18T03:19:20+00:00

I am using Mac. I have a c++ application, e.g. called myapp. Usually I

  • 0

I am using Mac. I have a c++ application, e.g. called myapp. Usually I can invoke the application, by ./myapp.

myapp application is capable of processing an image and returns some text result. Actually myapp application always has to allocate lots of memory at the beginning, so it is a bit slow if I have to run it multiple times.

Now I would like to do this

  1. myapp will work as a service which is always running. I will start myapp at the very beginning by ./myapp.

  2. when i have an image to process, I just want to type something like ./myapp arg1 arg2, here I don’t want to start a new process, I want to pass new arguments into the already running application and return results.

In order to make it, what should I do? I know myapp must contains a while loop which waits for requests. But how can I pass arguments during run time multitimes?

/*
It is something like e.g. ngix server. At the beginning you type ngix to start the service, and while it is running, you can still pass arguments by “ngix argument”, this command will not create a new process.
*/

/*
Actually I have a C++ image processing application and a python http server. Now what I do is, when the python server receives an image from a client, I start a new process by ./myapp imagelocation. myapp returns the processing results to the commandline and python captures it by “os.popen(“./myapp imagelocation,”r”).read().strip()”. but as I said, the C++ app takes too much time to initializes, so I want to initiaze it only once, and once I have an image, I just pass the image to the c++ app. Of course I know I can just let the C++ application to check if there is a new image saved, and call the method. But in this way, I cannot tell the python application the results */

  • 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-18T03:19:21+00:00Added an answer on June 18, 2026 at 3:19 am

    Yes you can do what you want but you can’t use the command line arguments. They are passed just once to your program, when it is started. To wait for a request you can check some other stream, for instance a file or a pipe periodically for new data.

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

Sidebar

Related Questions

I have installed a GEM called Ziya using the terminal in Mac OSx. However,
I have a Mac window based application using CoreData and Cocoa bindings to bind
I have an Cocoa Application (Mac OS X SDK 10.7) that is performing some
I have a problem automagically detecting my Arduino's serial port in Python, using Mac/Linux.
All, For all of this I am using Mac OSX Snow Leopard. I have
I have an SVN checkout on a Mac using subclipse. I want to be
I have a software that runs on mac (using terminal program) the program is
I have developed a Mac software (using DiscRecordingFramework and IOKit) that creates hybrid Video-DVD.
We have a team that built an agent in Mono using MonoDevelop on Mac
The post summarizes problems in using Screen in Mac's terminal when you have the

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.