Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Multiple threads processing connections#145

Merged
lodejard merged 12 commits into
devfrom
lodejard/multiloop
Jul 27, 2015
Merged

Multiple threads processing connections#145
lodejard merged 12 commits into
devfrom
lodejard/multiloop

Conversation

@lodejard

Copy link
Copy Markdown
Contributor

Uses named pipes to dispatch connected sockets to multiple thread loops

Currently uses the number of processors from Environment to create threads. Should be a server setting in the future.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's that doing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah - leftover code - wasn't meant to be pushed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I have convinced myself, that this code does not have a resource leak in the exceptional cases, but it's really, really hard to get to that conclusion. I know it's asynchronous code, but is there any way to streamline the control flow?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm sure there is - I'll file that as another issue in the interest of getting this PR merged.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we dispose this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's done in the callback below.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I now see that dispose is already being called in the callback. Thanks @loudej

I leave this here as a reminder to call write2.Dispose() to avoid the closure allocation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove commented code

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've verified that both pipeName's work on OS X. I think the logic where it defaults to "/tmp/..." for non-Windows OSs is good.

lodejard added a commit that referenced this pull request Jul 27, 2015
Multiple threads processing connections
@lodejard lodejard merged commit 166ec72 into dev Jul 27, 2015
@halter73 halter73 deleted the lodejard/multiloop branch August 4, 2015 01:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants