Skip to content

C media driver for windows #610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 24, 2019
Merged

Conversation

farnyser
Copy link
Contributor

This is a port of the C media driver for #windows (see issue #608).
It uses some C++ library (from the standard library) and windows API. VS2017 is needed to build.

Please let me know if there's something I can improve.

@mjpt777
Copy link
Contributor

mjpt777 commented Jan 11, 2019

Thanks. A lot of the approach looks good. However it breaks the build for other platforms. You can see the errors in the Travis CI build.

@mjpt777
Copy link
Contributor

mjpt777 commented Jan 11, 2019

Passing now on Linux but not on OSX. I also see a lot of warnings with this build.

@farnyser
Copy link
Contributor Author

I'll have a look at the warnings and hopefully it'll fix the OSX tests.

@tmontgomery
Copy link
Contributor

In general, this is not a bad start. But it will need a lot of work. In general (just initial thoughts from a review):

  • no C++ in C media driver lib or main
  • clean (or as clean as existing build is) for existing Linux and MacOS builds
  • no pollution of existing namespace by porting Linux system calls and thus making linking with cygwin/msys impossible. i.e. prefix all functions, etc. with aeron_, etc.
  • an initial cut can avoid it, but a real Windows port should use RIO
  • flags to file view, etc. need to accommodate some of the options that reflect the other platform behaviors. The defaults do not.
  • should support a DllMain (I did not see it) since some TLS is in use
  • should support a static lib setup in the main driver calls

@farnyser
Copy link
Contributor Author

I have less time to look into this this week, but I will try to address all the points you mentioned.
Should I close the PR until then ?

@mjpt777
Copy link
Contributor

mjpt777 commented Jan 14, 2019

Feel free to keep it open. It will not be going anywhere, especially as it currently does not build on OSX or Linux.

@farnyser
Copy link
Contributor Author

Hi @tmontgomery

flags to file view, etc. need to accommodate some of the options that reflect the other platform behaviors. The defaults do not.

Can you give me some details on that point ?

Also, i'm not sure about my fix to support static linking. Do you have a better idea than what I did in the aeron_dlopen.c file (b6e427f) ?

@@ -27,22 +27,22 @@
do \
{ \
dst = src; \
MemoryBarrier(); \
_ReadWriteBarrier(); \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also when updating these why not move to using std::atomic fences given you specified C17 for windows. I'd feel happier with C11 for wider support.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though you guys wanted to stay with C ?
I removed all the C++ code, so it should be fine in C11 now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes stay with C, not C++. I meant stdatomic.h.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSVC does not really support C11, and stdatomic.h does not seems to be supported.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see in Herb's blog post that they are preferring C++ over C. I guess you will have to go with the deprecated macros.

@farnyser
Copy link
Contributor Author

@mjpt777 Hi, I Think I have addressed all the point you mentioned (but the one about the flags to mmap #610 (comment))

Can I do anything else to help go forward with this PR ?

@tmontgomery
Copy link
Contributor

@farnyser I will review later today once I have some time. Thanks!

@tmontgomery
Copy link
Contributor

This looks really nice now. Thanks so much. There's a few little cleanup things, but this is very well done. Thanks for putting the time, effort, and putting up with our long list of requests! Very happy to merge. And I will give it a spin soon as well.

@tmontgomery tmontgomery merged commit 4725b86 into aeron-io:master Jan 24, 2019
mjpt777 added a commit that referenced this pull request Jan 25, 2019
@msalai
Copy link

msalai commented Mar 14, 2019

Is C media driver for Windows now fully functional?

@mjpt777
Copy link
Contributor

mjpt777 commented Mar 14, 2019

We have not had time or sponsorship to look in any detail at this yet.

@msalai
Copy link

msalai commented Mar 14, 2019

So this is partially functional, or not functional at all for now? I would like to use it in my project but don't understand in what phase of development for c/c++ it is currently. Does it just need testing or what?

@mjpt777
Copy link
Contributor

mjpt777 commented Mar 14, 2019

Quite simply we have not had the time or sponsorship to look at it in any detail so we cannot comment on how well it works or not. The code looks reasonable but missing a few features and we have not tested it.

@msalai
Copy link

msalai commented Mar 14, 2019

I understand. Is compiled (Windows) version of c/c++ driver available somewhere online since I am unable to build it and I would like to test it?

@mjpt777
Copy link
Contributor

mjpt777 commented Mar 14, 2019

I'm not aware of posted binaries for Windows. People tend to build their own version if they want to use it. We can provide supported builds for clients with a support contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants