# Multiprocess and http in DeepStream

**URL:** <https://forums.developer.nvidia.com/t/multiprocess-and-http-in-deepstream/263440>\
**Category:** DeepStream SDK\
**Tags:** deepstream\
**Created:** [August 17, 2023, 10:49am UTC](https://forums.developer.nvidia.com/t/multiprocess-and-http-in-deepstream/263440 "2023-08-17T10:49:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![2630862330](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@2630862330](https://forums.developer.nvidia.com/u/2630862330)\
**Post date:** [August 17, 2023, 10:49am UTC](https://forums.developer.nvidia.com/t/multiprocess-and-http-in-deepstream/263440/1 "2023-08-17T10:49:53Z")

</div>

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU)**  
GPU  
**• DeepStream Version**  
DeepStream 6.1  
**• Issue Type( questions, new requirements, bugs)**

Here is my program structure:

 ![1692268759105](https://global.discourse-cdn.com/nvidia/original/4X/4/2/1/421571beab5c52f6abd880309db27880617638d7.jpeg)

I’m trying to use multiprocessing to produce multiple subprocess to run deepstream app by my server in C++. I write a http program to control the producing subprocess. When a request coming, the main process will produce a subproccess runing deepstream and create a pipe to communicate this subprocess and main process .To filter the model detect result, I have to use http to receive another request to get filter params like confidence and detect scope, then transmit the filter params to corresponding subprocess by pipe in a thread of subprocess. I use a global variable called “global\_alarm\_params” to save the params in project and make sure that every coding file can get this global variable.

I have already test the multiprocess logic and the data transmitting by pipe in thread logic, they are all correct.

When I run the coding, create the first, second subprocess successfully, but creating the third subprocess, the error occurd like this, could not run the third subprocess successfully.

```auto
Device is in streaming mode
ERROR from sink_sub_bin_encoder1: Could not get/set settings from/on resource.
Debug info: gstv4l2object.c(3507): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline/GstBin:processing_bin_0/GstBin:sink_bin/GstBin:sink_sub_bin1/nvv4l2h264enc:sink_sub_bin_encoder1:
ERROR from sink_bin_queue: Internal data stream error.

```

The another problem is in this coding:

```auto
process_meta (AppCtx * appCtx, NvDsBatchMeta * batch_meta, GstBuffer * buf = nullptr)
{
  // For single source always display text either with demuxer or with tiler
  if (!appCtx->config.tiled_display_config.enable ||
      appCtx->config.num_source_sub_bins == 1) {
    appCtx->show_bbox_text = 1;
  }
    // test global variable
      std::cout << "params confidence:" << global_alarm_params.confidence << std::endl;

```

When I start the deepstream subprocess and try to change the params in subprocess by http of main process and the pipe, and cout it in function “process meta” in file “deepstream\_app.c”, it occurd a very confusing error:

```auto
(deepstream-app:271495): GStreamer-CRITICAL **: 10:30:22.948: 0x7f1c7413b5e0: failed to wake event: Bad file descriptor

(deepstream-app:271495): GStreamer-CRITICAL **: 10:30:22.948: 0x7f1c7413b5e0: failed to wake event: Bad file descriptor

(deepstream-app:271495): GStreamer-CRITICAL **: 10:30:22.948: 0x7f1c7413b5e0: failed to wake event: Bad file descriptor
params confidence:0.8

(deepstream-app:271495): GStreamer-CRITICAL **: 10:30:22.971: 0x7f1c7413b5e0: failed to wake event: Bad file descriptor
params confidence:0.8

(deepstream-app:271495): GStreamer-CRITICAL **: 10:30:22.996: 0x7f1c7413b5e0: failed to wake event: Bad file descriptor

(deepstream-app:271495): GStreamer-CRITICAL **: 10:30:22.996: 0x7f1c7413b5e0: failed to wake event: Bad file descriptor

(deepstream-app:271495): GStreamer-CRITICAL **: 10:30:22.996: 0x7f1c7413b5e0: failed to wake event: Bad file descriptor

```

If you meet this question or have the same requirement like me, please contact with me to solve this together.

Thank you so much for your help.

---

<div class="post-metadata">

**Author:** ![yuweiw](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/yuweiw/32/101255_2.png) [@yuweiw](https://forums.developer.nvidia.com/u/yuweiw)\
**Post date:** [August 18, 2023, 2:49am UTC](https://forums.developer.nvidia.com/t/multiprocess-and-http-in-deepstream/263440/3 "2023-08-18T02:49:46Z")

</div>

**There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks**

There are limited resources for CPU, GPU, Memory, Encoder, Deocder… If you run multiple deepstream apps in parallel, it will repeatedly consume resources. Can the following demo meet your needs:`sources\apps\sample_apps\deepstream-server`?

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [September 5, 2023, 2:00am UTC](https://forums.developer.nvidia.com/t/multiprocess-and-http-in-deepstream/263440/4 "2023-09-05T02:00:05Z")

</div>

Closed on September 5, 2023, 2:00am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
