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

future TODO main task scheduler for Windows #19

Open
FelixPetriconi opened this issue Dec 7, 2016 · 8 comments
Open

future TODO main task scheduler for Windows #19

FelixPetriconi opened this issue Dec 7, 2016 · 8 comments
Labels

Comments

@FelixPetriconi
Copy link
Member

Open issue:
future.hpp:1441
// TODO (sparent) : We need a main task scheduler for STLAB_TASK_SYSTEM_WINDOWS

@FelixPetriconi
Copy link
Member Author

Can only be implemented for Windows 8 and 10

@FelixPetriconi
Copy link
Member Author

Use the serial queue as a backup, if the OS not support one.

@FelixPetriconi FelixPetriconi added this to the 1.2 milestone Nov 11, 2017
@zurrutik
Copy link

zurrutik commented Jun 4, 2018

Hi,

At the moment I am replacing my own Concurrency library with stlab and I noticed that the main_executor is not implemented in neither Classic Win32 nor UWP( Windows 8/10 )

I haven't investigated the UWP case yet, but the Classic Win32 solution to the problem should be maybe something like this?
main_executor_changes.txt

wndProc.txt

Application::nativeWindowHandle() and Application::STLAB_EXECUTE_TASK should be provided by the application itself:

  • nativeWindowHandle() should return the HWND of our main window( e.g. the value returned from Win32 CreateWindow() function )

  • STLAB_EXECUTE_TASK should be the message id we want to assign( a safe value would be to use static constexpr int STLAB_EXECUTE_TASK = WM_USER + 0x0001; )

Do you think this can be implemented more elegantly? Any pointers?

Cheers

@FelixPetriconi
Copy link
Member Author

I just changed to Windows 10, so I did not look into a solution so far.

I did an implementation for Qt some while ago. It is at the end of my ACCU 2018 slides: https://github.com/ACCUConf/ACCUConf_PDFs/blob/master/2018/Felix_Petriconi_-_There_Is_A_New_Future.pdf

As soon as I have time, I will add it.

@zurrutik
Copy link

zurrutik commented Jun 5, 2018

Thanks for the info Felix!

@FelixPetriconi FelixPetriconi removed this from the 1.2 milestone Jun 27, 2018
@dabrahams
Copy link
Contributor

@sean-parent I'm working on #412 but not sure how to address this one. Input?

@dabrahams dabrahams added bug and removed enhancement labels Jun 21, 2022
@FelixPetriconi
Copy link
Member Author

@sean-parent I'm working on #412 but not sure how to address this one. Input?

@dabrahams Since there are different main loops for different Windows tool sets, as far as I see it, it can be difficult to provide one that fits all. So far I have not seen a request for a main_executor. (I just work with Qt on Windows.)

@sean-parent
Copy link
Member

I spent some time looking at this - I had always assumed Win32 had a main thread/window. But that does not appear to be the case. Instead, it seems closer to an actor model where every (root) window has its thread and message queue. The intent of the main_dispatcher wasn't to change the model of the underlying OS facilities but to provide a common way to interact with them. I think we need to rethink the main_executor idea. Perhaps instead we have a way to construct an executor from a platform resource. I would rather not provide a main_executor() where it doesn't make sense.

That said, MFC apps have a CWinApp which derives from CWinThread so a main-executor would make sense with the MFC framework.

nickpdemarco pushed a commit that referenced this issue Aug 4, 2022
New construct for libraries that groups classes and functions together
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants