Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

bridgedragon
Copy link

@bridgedragon bridgedragon commented Nov 20, 2021

If method "HandleIncomingMessagesAsync()" is called before the websocket client is connected, the while() loop will get stuck in starvation condition, making continuous comparison without any CPU pause. This won't allow "_clientWebSocket" to connect, because CPU is stuck in that method, not allowing any other tasks to continue.

I propose initializing the listener when "_clientWebSocket" is already connected. May I propose other solutions, with an AutoResetEvent variable setted when a request is added to "_requests", if you do not like to initialize the listener at this point.

Starvation condition is tested and triggered in Ubuntu 21.04 (and I suppose it is happening in another OS). When "StreamingWebSocketClient" is instantiated in any project, the program will be stuck by 100% CPU usage.

@juanfranblanco
Copy link
Member

As per other threads.. (and new people coming over) I did not see any mayor improvements but keeping it open, in case it helps others.

@distoken001
Copy link

管理员在吗 快点把这个pr合并了

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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.