-
October 15th, 2019, 01:15 AM
#1
delay in dll
Hi ,
The client code calls my dll and my dll writes into their o/p.
But the issue is , if there is long time, for my dll to do some processing, how to make sure the client looks into o/p after this processing is over. Because the o/p array might be half written
I was told that, the client waits for the function to end. But others arguing that, the array might be half baked !
thanks a lot for your inputs !
Pdk
-
October 15th, 2019, 04:22 AM
#2
Re: delay in dll
The client code calls a function that is located within the .dll.
What is o/P?
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
October 15th, 2019, 06:24 AM
#3
Re: delay in dll
output is pointer to memory location allocated by the client
-
October 15th, 2019, 08:30 AM
#4
Re: delay in dll
Well if the called function writes to this memory, then presumably unless the function is threaded and returns whilst a background thread completes (asynchronous transfer), then when the function terminates and returns to the caller then all the writing required to the memory has been completed? Is the function single or multi-threaded? Is the transfer synchronous or asynchronous?
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
October 15th, 2019, 08:42 AM
#5
Re: delay in dll
I think it is single threaded
-
October 15th, 2019, 09:16 AM
#6
Re: delay in dll
Originally Posted by pdk5
I think it is single threaded
It either is or is not. In programming you determine what is happening - you don't guess.
So why might the o/p be only half written when control is passed back to the caller?
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
October 15th, 2019, 09:24 AM
#7
Re: delay in dll
because it is taking long to complete as it is just a function call and there is no way of knowing if o/p is written or not
-
October 15th, 2019, 10:35 AM
#8
Re: delay in dll
Originally Posted by pdk5
because it is taking long to complete as it is just a function call and there is no way of knowing if o/p is written or not
It doesn't matter how long it takes to complete. Only the fact whether this "function" may or may not return before the writing has completed matters.
Victor Nijegorodov
-
October 15th, 2019, 11:01 AM
#9
Re: delay in dll
and whether it has completed successfully or not.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
October 15th, 2019, 11:29 AM
#10
Re: delay in dll
Originally Posted by 2kaud
and whether it has completed successfully or not.
Agree!
Victor Nijegorodov
-
October 15th, 2019, 12:26 PM
#11
Re: delay in dll
Yes, my collegue came from multithreaded background and was confused about this.
Eventhough i havent worked on multithreading much, but i knew, in case of single thread this wont be issue. But couldnot argue further because of my limited computer programming knowledge.
But anyway thanks a lot kaud and victor. It is much appreciated.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|