C++ Client - Accessing Ignite Grid as Pointer

classic Classic list List threaded Threaded
2 messages Options
Kannan Kannan
Reply | Threaded
Open this post in threaded view
|

C++ Client - Accessing Ignite Grid as Pointer

This post has NOT been accepted by the mailing list yet.
Hi,

I am using Ignite C++ client, In which i would like to use shared memory concept to store the initiated Grid and to make use of this Grid pointer in other applications. But i am facing issue while accessing this Grid Pointer.

To be precise, here with shared the code snippet with simple example,

IgniteConfiguration cfg;
Ignite grid = Ignition::Start(cfg);

Ignite *pGrid = &grid;

//Cache<int, std::string> cache = grid.GetOrCreateCache<int, std::string>("myCache");

Cache<int, std::string> cache = pGrid->GetOrCreateCache<int, std::string>("myCache");


In this code, If I try to access “GetOrCreateCache” using grid pointer(pGrid), I am getting segmentation fault.  Is there anything wrong in this ?

With Regards,
S.Kannan
Igor Sapego Igor Sapego
Reply | Threaded
Open this post in threaded view
|

Re: C++ Client - Accessing Ignite Grid as Pointer

Hello Kannan,

I can't reproduce the issue you have described. Which compiler do you use? Also I'm not sure if the code you have provided is exactly the code that  fails in your case or are you trying to access "pGrid" pointer from the another thread/process?

Also, please properly subscribe to the user list (this way we will not have to manually approve your emails). All you need to do is send an email to “ user-subscribe@ignite.apache.org” and follow simple instructions in the reply.

Best Regards,
Igor