Is it possible to simulate Signal & slot in IPC?












0















I found that Qt and OpenCV 4.0.0 are not compatible because the former one is for 32bit, and the latter one is for 64bit. (Building 64bit Qt was quite puzzling to me) So, I decided to use IPC to implement my application. However, I have no experience of using it, but just knowing it theoretically.



This is what I want to implement : There are two processes. The first one reads a frame from webcam (It is combined with Qt), sends it to the second one as a form of cv::Mat. And the second one does landmark detection, draws a circle in the Mat and resends it to the first one.



What I'm curious about is that how the second process knows that the frame(Mat) has been sent.
If I implement it like following, it seems quite inefficient.



while(nothing in shared memory);
do_something()


The second process should sleep while there is no frame(Mat) to be processed, and be woke up by the first process when there's one.
How can I implement such thing?










share|improve this question


















  • 3





    To involve IPC, because one of the libraries hasn't been build for the right architecture is a questionable decision. If you don't know the way to the next bakery shop just ask somebody. Calling the police is the 2nd best option although they probably could solve your issue as well. (But you probably have to pay a lot for this.) ;-)

    – Scheff
    Nov 24 '18 at 8:47






  • 2





    "because the former one is for 32bit" Huh?

    – πάντα ῥεῖ
    Nov 24 '18 at 8:47











  • @πάντα ῥεῖ stackoverflow.com/questions/53263199/… Qt which I'm using now is not compatible with 64bit MinGW. However, I have to use 64bit MinGW to be compatible with OpenCV 4.0.0. So I need to rebuild Qt as 64bit but it happens to be too complex for me.

    – James
    Nov 24 '18 at 8:55






  • 1





    @James Implementing a solution using IPC would be way more complex believe me.

    – πάντα ῥεῖ
    Nov 24 '18 at 8:57











  • @πάντα ῥεῖ I'll try it again then as much as possible.

    – James
    Nov 24 '18 at 9:25
















0















I found that Qt and OpenCV 4.0.0 are not compatible because the former one is for 32bit, and the latter one is for 64bit. (Building 64bit Qt was quite puzzling to me) So, I decided to use IPC to implement my application. However, I have no experience of using it, but just knowing it theoretically.



This is what I want to implement : There are two processes. The first one reads a frame from webcam (It is combined with Qt), sends it to the second one as a form of cv::Mat. And the second one does landmark detection, draws a circle in the Mat and resends it to the first one.



What I'm curious about is that how the second process knows that the frame(Mat) has been sent.
If I implement it like following, it seems quite inefficient.



while(nothing in shared memory);
do_something()


The second process should sleep while there is no frame(Mat) to be processed, and be woke up by the first process when there's one.
How can I implement such thing?










share|improve this question


















  • 3





    To involve IPC, because one of the libraries hasn't been build for the right architecture is a questionable decision. If you don't know the way to the next bakery shop just ask somebody. Calling the police is the 2nd best option although they probably could solve your issue as well. (But you probably have to pay a lot for this.) ;-)

    – Scheff
    Nov 24 '18 at 8:47






  • 2





    "because the former one is for 32bit" Huh?

    – πάντα ῥεῖ
    Nov 24 '18 at 8:47











  • @πάντα ῥεῖ stackoverflow.com/questions/53263199/… Qt which I'm using now is not compatible with 64bit MinGW. However, I have to use 64bit MinGW to be compatible with OpenCV 4.0.0. So I need to rebuild Qt as 64bit but it happens to be too complex for me.

    – James
    Nov 24 '18 at 8:55






  • 1





    @James Implementing a solution using IPC would be way more complex believe me.

    – πάντα ῥεῖ
    Nov 24 '18 at 8:57











  • @πάντα ῥεῖ I'll try it again then as much as possible.

    – James
    Nov 24 '18 at 9:25














0












0








0








I found that Qt and OpenCV 4.0.0 are not compatible because the former one is for 32bit, and the latter one is for 64bit. (Building 64bit Qt was quite puzzling to me) So, I decided to use IPC to implement my application. However, I have no experience of using it, but just knowing it theoretically.



This is what I want to implement : There are two processes. The first one reads a frame from webcam (It is combined with Qt), sends it to the second one as a form of cv::Mat. And the second one does landmark detection, draws a circle in the Mat and resends it to the first one.



What I'm curious about is that how the second process knows that the frame(Mat) has been sent.
If I implement it like following, it seems quite inefficient.



while(nothing in shared memory);
do_something()


The second process should sleep while there is no frame(Mat) to be processed, and be woke up by the first process when there's one.
How can I implement such thing?










share|improve this question














I found that Qt and OpenCV 4.0.0 are not compatible because the former one is for 32bit, and the latter one is for 64bit. (Building 64bit Qt was quite puzzling to me) So, I decided to use IPC to implement my application. However, I have no experience of using it, but just knowing it theoretically.



This is what I want to implement : There are two processes. The first one reads a frame from webcam (It is combined with Qt), sends it to the second one as a form of cv::Mat. And the second one does landmark detection, draws a circle in the Mat and resends it to the first one.



What I'm curious about is that how the second process knows that the frame(Mat) has been sent.
If I implement it like following, it seems quite inefficient.



while(nothing in shared memory);
do_something()


The second process should sleep while there is no frame(Mat) to be processed, and be woke up by the first process when there's one.
How can I implement such thing?







c++ qt opencv ipc






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 24 '18 at 8:42









JamesJames

587




587








  • 3





    To involve IPC, because one of the libraries hasn't been build for the right architecture is a questionable decision. If you don't know the way to the next bakery shop just ask somebody. Calling the police is the 2nd best option although they probably could solve your issue as well. (But you probably have to pay a lot for this.) ;-)

    – Scheff
    Nov 24 '18 at 8:47






  • 2





    "because the former one is for 32bit" Huh?

    – πάντα ῥεῖ
    Nov 24 '18 at 8:47











  • @πάντα ῥεῖ stackoverflow.com/questions/53263199/… Qt which I'm using now is not compatible with 64bit MinGW. However, I have to use 64bit MinGW to be compatible with OpenCV 4.0.0. So I need to rebuild Qt as 64bit but it happens to be too complex for me.

    – James
    Nov 24 '18 at 8:55






  • 1





    @James Implementing a solution using IPC would be way more complex believe me.

    – πάντα ῥεῖ
    Nov 24 '18 at 8:57











  • @πάντα ῥεῖ I'll try it again then as much as possible.

    – James
    Nov 24 '18 at 9:25














  • 3





    To involve IPC, because one of the libraries hasn't been build for the right architecture is a questionable decision. If you don't know the way to the next bakery shop just ask somebody. Calling the police is the 2nd best option although they probably could solve your issue as well. (But you probably have to pay a lot for this.) ;-)

    – Scheff
    Nov 24 '18 at 8:47






  • 2





    "because the former one is for 32bit" Huh?

    – πάντα ῥεῖ
    Nov 24 '18 at 8:47











  • @πάντα ῥεῖ stackoverflow.com/questions/53263199/… Qt which I'm using now is not compatible with 64bit MinGW. However, I have to use 64bit MinGW to be compatible with OpenCV 4.0.0. So I need to rebuild Qt as 64bit but it happens to be too complex for me.

    – James
    Nov 24 '18 at 8:55






  • 1





    @James Implementing a solution using IPC would be way more complex believe me.

    – πάντα ῥεῖ
    Nov 24 '18 at 8:57











  • @πάντα ῥεῖ I'll try it again then as much as possible.

    – James
    Nov 24 '18 at 9:25








3




3





To involve IPC, because one of the libraries hasn't been build for the right architecture is a questionable decision. If you don't know the way to the next bakery shop just ask somebody. Calling the police is the 2nd best option although they probably could solve your issue as well. (But you probably have to pay a lot for this.) ;-)

– Scheff
Nov 24 '18 at 8:47





To involve IPC, because one of the libraries hasn't been build for the right architecture is a questionable decision. If you don't know the way to the next bakery shop just ask somebody. Calling the police is the 2nd best option although they probably could solve your issue as well. (But you probably have to pay a lot for this.) ;-)

– Scheff
Nov 24 '18 at 8:47




2




2





"because the former one is for 32bit" Huh?

– πάντα ῥεῖ
Nov 24 '18 at 8:47





"because the former one is for 32bit" Huh?

– πάντα ῥεῖ
Nov 24 '18 at 8:47













@πάντα ῥεῖ stackoverflow.com/questions/53263199/… Qt which I'm using now is not compatible with 64bit MinGW. However, I have to use 64bit MinGW to be compatible with OpenCV 4.0.0. So I need to rebuild Qt as 64bit but it happens to be too complex for me.

– James
Nov 24 '18 at 8:55





@πάντα ῥεῖ stackoverflow.com/questions/53263199/… Qt which I'm using now is not compatible with 64bit MinGW. However, I have to use 64bit MinGW to be compatible with OpenCV 4.0.0. So I need to rebuild Qt as 64bit but it happens to be too complex for me.

– James
Nov 24 '18 at 8:55




1




1





@James Implementing a solution using IPC would be way more complex believe me.

– πάντα ῥεῖ
Nov 24 '18 at 8:57





@James Implementing a solution using IPC would be way more complex believe me.

– πάντα ῥεῖ
Nov 24 '18 at 8:57













@πάντα ῥεῖ I'll try it again then as much as possible.

– James
Nov 24 '18 at 9:25





@πάντα ῥεῖ I'll try it again then as much as possible.

– James
Nov 24 '18 at 9:25












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53456565%2fis-it-possible-to-simulate-signal-slot-in-ipc%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53456565%2fis-it-possible-to-simulate-signal-slot-in-ipc%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen