ValveSoftware / ValveSoftware/GameNetworkingSockets

Add mechanism for event driven app to wait efficiently

Open
#52 0 comments 4 reactions 1 assignee View on GitHub

@zpostfacto is already working on this.

Since Jan 29, 2019.

enhancement
Dominant language
C++
Stars
9.9k
Forks
749
Avg merge
1d 2h
Merged PRs (30d)
1

Description

We've been designing for real-time apps that "tick" on a relatively high frequency, and that will poll for messages at this interval.

We should provide a mechanism for apps that don't fit this model, e.g. the more traditional event-driven server model where you select()/poll() and then wake up and process the event immediately.

I think the simplest way to do this is to provide a config parameter that specifies a callback when a new message arrives. The intention would be that the app would use some mechanism (e.g. set an event on windows) to wake up their other thread that is actually going to do the work. I'm worried that somebody will actually try to process the message in the callback, and that would probably be bad. If necessary, we could put these callbacks on another thread, so that they cannot shoot themselves in the foot by doing dumb stuff.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.