GithubHelp home page GithubHelp logo

shredder's Introduction

Hello 👀, I'm Tom!

A passionate C# developer who enjoys building innovative and exceptional software solutions

- To be honest with you. Most of my projects are closed source. Sorry about that. -



Technologies used:

C Sharp Dart .NET .NET Blazor JavaScript Python HTML Css MSSQL SQLLite

Version Control and Development tools used:

Git GitHub Azure Devops Visual Studio Visual Studio Code

Operating Systems familiar with:

Linux Windows



  luckyone-cc



  luckyone-cc



  luckyone-cc



  • Discord: the.luckyone

shredder's People

Contributors

luckyone-cc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

egida whoami2323

shredder's Issues

UpdClient#SendAsync cannot be multithreaded; Making the threads parameter useless

The following lines and code paths are affected:

int threads = string.IsNullOrWhiteSpace(threadsInput) ? 100 : 0;

Shred shred = new Shred(ip, port, force, threads);

Shredder/Shred.cs

Lines 39 to 42 in 72579f8

for (int i = 0; i < _threads; i++)
{
await Task.Run(SendAsync);
}


When replacing the "100" with only "1" you will notice that both 100 threads and 1 thread yield the same throughput.

image

image


That's because Sockets do not allow concurrent SendAsync() calls.

See
dotnet/runtime#26843 (comment)
https://tangentsoft.com/wskfaq/intermediate.html#threadsafety

3.10 - Is Winsock thread-safe?
On modern Windows stacks, yes, it is, within limits.
It is safe, for instance, to have one thread calling send() and another thread calling recv() on a single socket.
By contrast, it’s a bad idea for two threads to both be calling send() on a single socket. This is “thread-safe” in the limited sense that your program shouldn’t crash, and you certainly shouldn’t be able to crash the kernel, which is handling these send() calls. The fact that it is “safe” doesn’t answer key questions about the actual effect of doing this. Which call’s data goes out first on the connection? Does it get interleaved somehow? Don’t do this.
Instead of multiple threads accessing asingle socket, you may want to consider setting up a pair of network I/O queues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.