> The standard and correct way to handle this is to embrace the
client-server nature of gRPC.

I could easily be wrong but my interpretation is that exec1 does not
involve gRPC. It's implied that exec1 and exec2 are in the same process
because the op expects the pointer will reference the same storage without
using shared memory. This is not unusual for C but GO requires the use of
the UNSAFE class which should be avoided.

Without details, we are guessing at what the OP is attempting to achieve.
We're assuming that gRPC is the right solution for the problem being solved.

On Sat, Jul 26, 2025 at 4:07 AM Sharon Mafgaoker <sha...@cloud5.co.il>
wrote:

> The Correct Approach: Return the Updated Value
>
>  The plugin (exec2) should perform its logic and then *return the
> modified data* back to the main application (exec1).
>
> The workflow should be:
>
>    1.
>
>    *exec1 (Client):* Calls a gRPC function on exec2, passing the current
>    state of the item in the request.
>    2.
>
>    *exec2 (Server):* Receives the item (as a copy), performs its updates
>    on that copy.
>    3.
>
>    *exec2 (Server):* Returns the fully updated item in the gRPC response.
>    4.
>
>    *exec1 (Client):* Receives the response and updates its original item
>    with the returned data.
>
>
>
> Sharon Mafgaoker – Senior Solutions Architect
>
> M. 050 995 99 16 | sha...@cloud5.co.il
>
>
>
>
> On Sat, 26 Jul 2025 at 4:06 Robert Engels <reng...@ix.netcom.com> wrote:
>
>> You can’t typically do this from user code. You should used shared memory
>> or a memory mapped file, or socket communication.
>>
>> On Jul 25, 2025, at 7:20 PM, Léa Galet <leaesperee.ga...@gmail.com>
>> wrote:
>>
>> 
>> Hi,
>> I have 2 executables in go (called exec1 and exec 2)
>> exec1 is the main application, loading exec2 as a grpc plugin
>> Exec 1 is the one making the calls to exec 2, so there's a possibility of
>> downward communication
>> i wanted my exec2 to be able to update some values of an item passed from
>> exec1 so i gave the item as a pointer (wanted to use the inline update
>> property of pointers)
>> unfortunatly, in exec2 it's a copy of the pointer and not the pointer
>> directly (i printed the pointer adresses to be sure)
>> i don't seem to find a definitive answer anywhere so
>> Is there a method to have exec2 use the same pointer as exec1?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/CAByJhJkVHBtCxHLmtvB7pKqEOyx8Co-pSSoh1YpsPWadmjLAkw%40mail.gmail.com.

Reply via email to