Skip to content
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

Figure out the story around Send and Sync #71

Open
Boddlnagg opened this issue May 18, 2019 · 0 comments
Open

Figure out the story around Send and Sync #71

Boddlnagg opened this issue May 18, 2019 · 0 comments

Comments

@Boddlnagg
Copy link
Collaborator

I haven't fully understood the Windows Runtime threading model yet. We should probably mark generated class as Send and/or Sync based on the ThreadingModel and MarshallingBehavior attributes. If I understand https://docs.microsoft.com/en-us/cpp/cppcx/threading-and-marshaling-c-cx?view=vs-2019 correctly, I think we could do the following:

I think we can mark a class as Sync if ThreadingModel is Both or MTA, based on this sentence:

If you author a class that has ThreadingModel=Both or ThreadingModel=MTA, make sure that the class is thread-safe.

I think we can mark a class as Send if MarshallingBehavior is Agile, based on this sentence:

In the vast majority of cases, instances of Windows Runtime classes, like standard C++ objects, can be accessed from any thread. Such classes are referred to as "agile"

It would be great if someone with more understanding could confirm these assumptions.

Related: #63, #18, #62, #60

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

No branches or pull requests

1 participant