maria-discuss team mailing list archive
-
maria-discuss team
-
Mailing list archive
-
Message #02975
Re: writing plugin with .net language (C#)
Hi Roberto,
you could have a try at it with Golang, it can wrap C code easily
https://golang.org/cmd/cgo/
Best regards,
Guillaume Lefranc
RemoteDBA Services Manager - MariaDB Corporation Ab
On Sun, Oct 4, 2015 at 3:26 AM, Roberto Spadim <roberto@xxxxxxxxxxxxx>
wrote:
> hummm, it's like creating a ".dll" that export functions to other program
> call it? in this case your fast bit UDF functions export init/denit
> functions to mysql, right? and you are using C++ or C language when you use
> "extern"? i don't know how compiler know if it's a C or C++ code
>
> 2015-10-03 20:36 GMT-03:00 Justin Swanhart <greenlion@xxxxxxxxx>:
>
>> extern "C" {
>>
>> Makes the function use CDECL calling conventions, which is equivalent to
>> setting the .NET code to use CDECL calling conventions. Any language that
>> supports exporting symbols with CDECL calling conventions supports
>> interoperating with C (it stands for C declarations aka C calling
>> conventions).
>>
>> --Justin
>>
>> Sent from my iPhone
>>
>> On Oct 3, 2015, at 1:57 PM, Roberto Spadim <roberto@xxxxxxxxxxxxx> wrote:
>>
>> sorry guys, i'm a bit confuse about c++ and c
>>
>> i'm reading your fastbit udf code
>>
>> at /fb_udf.h
>> you have a C code, right?
>> and at fb_udf.cpp a c++ code
>>
>> you can mix c and c++ at the same code?
>>
>>
>> at udf.h
>> what this do?
>>
>> "
>> extern "C" { "
>> those functions should be undestood as "C" instead of "C++", or compiler
>> should "export" those c++ function to "C" "code", or something related to C
>> and namespaces ?
>>
>> sorry it's not mysql specific but i'm not finding some C++ plugins
>> examples
>>
>>
>> 2015-09-21 13:43 GMT-03:00 Roberto Spadim <roberto@xxxxxxxxxxxxx>:
>>
>>> :D nice
>>> what i will is something like:
>>>
>>> 1) a plugin daemon that receive a tcp/ip connection with a double linked
>>> list "feed" (something like: clear list, delete from position x to y,
>>> delete position x, insert at position x, update position x, move position x
>>> to y)
>>> 2) save this feed to a myisam/spider/innodb/anyother engine (i'm
>>> thinking about using a mysql handler api) (i didn't check how it works, but
>>> i think handler sock use it)
>>> 3) keep the double linked list at memory (reconstruct the list when
>>> server shutdown, maybe make some snapshots to avoid a long reconstruct,
>>> something like after X lines of feed, save the list, or after x minutes)
>>> 4) a engine to read the double linked list at memory (i don't know yet
>>> how do this, but i will need some control about reading a shared memory,
>>> how to access this shared memory from daemon plugin using storage engine)
>>> 5) a engine to read information about what daemon is doing (like 4)
>>> 6) at same plugin daemon, create a tcp/ip connection to "export" the
>>> same feed to others users (just a proxy, not a big problem)
>>>
>>> at top level i think i will have 1 daemon plugin + 1 storage engine
>>> plugin
>>>
>>> i'm thinking about c++ 11 cause it have double linked lists, threads,
>>> atomic, sockets, and i dont need others libs (maybe i'm wrong, but that was
>>> my first impression about c++11)
>>>
>>> 2015-09-21 13:34 GMT-03:00 Justin Swanhart <greenlion@xxxxxxxxx>:
>>>
>>>> Hi,
>>>>
>>>> My fastbit UDF use C++ 11 no problem.
>>>>
>>>> https://github.com/greenlion/FastBit_UDF
>>>>
>>>> On Fri, Sep 18, 2015 at 11:52 PM, Sergei Golubchik <serg@xxxxxxxxxxx>
>>>> wrote:
>>>>
>>>>> Hi, Roberto!
>>>>>
>>>>> On Sep 18, Roberto Spadim wrote:
>>>>> > guys , i'm still with doubts... but not more about c#, now about c++
>>>>> > i was thinking about rewrite the code with c++
>>>>> >
>>>>> > my doubt is.... could i use C++ 11 ? or i will have problem with
>>>>> mariadb
>>>>> > makefiles etc etc?
>>>>>
>>>>> Sure, you can use any language you want, C++11 is perfectly fine too.
>>>>> cmake doesn't care.
>>>>>
>>>>> Regards,
>>>>> Sergei
>>>>>
>>>>> _______________________________________________
>>>>> Mailing list: https://launchpad.net/~maria-discuss
>>>>> Post to : maria-discuss@xxxxxxxxxxxxxxxxxxx
>>>>> Unsubscribe : https://launchpad.net/~maria-discuss
>>>>> More help : https://help.launchpad.net/ListHelp
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Roberto Spadim
>>> SPAEmpresarial - Software ERP
>>> Eng. Automação e Controle
>>>
>>
>>
>>
>> --
>> Roberto Spadim
>> SPAEmpresarial - Software ERP
>> Eng. Automação e Controle
>>
>>
>
>
> --
> Roberto Spadim
> SPAEmpresarial - Software ERP
> Eng. Automação e Controle
>
> _______________________________________________
> Mailing list: https://launchpad.net/~maria-discuss
> Post to : maria-discuss@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~maria-discuss
> More help : https://help.launchpad.net/ListHelp
>
>
Follow ups
References
-
writing plugin with .net language (C#)
From: Roberto Spadim, 2015-09-14
-
Re: writing plugin with .net language (C#)
From: Sergei Golubchik, 2015-09-14
-
Re: writing plugin with .net language (C#)
From: Roberto Spadim, 2015-09-14
-
Re: writing plugin with .net language (C#)
From: Justin Swanhart, 2015-09-14
-
Re: writing plugin with .net language (C#)
From: Roberto Spadim, 2015-09-18
-
Re: writing plugin with .net language (C#)
From: Roberto Spadim, 2015-09-19
-
Re: writing plugin with .net language (C#)
From: Sergei Golubchik, 2015-09-19
-
Re: writing plugin with .net language (C#)
From: Justin Swanhart, 2015-09-21
-
Re: writing plugin with .net language (C#)
From: Roberto Spadim, 2015-09-21
-
Re: writing plugin with .net language (C#)
From: Roberto Spadim, 2015-10-03
-
Re: writing plugin with .net language (C#)
From: Justin Swanhart, 2015-10-03
-
Re: writing plugin with .net language (C#)
From: Roberto Spadim, 2015-10-04