Code Monkey home page Code Monkey logo

Comments (5)

uNetworkingAB avatar uNetworkingAB commented on July 17, 2024

This is not a complete program and it's not a proper bug report. You can't just dump your project and expect someone else to solve your problems, you need to specify an isolated problem with the library, not just "my project is not working, fix it".

from uwebsockets.

suzixin avatar suzixin commented on July 17, 2024

it crash in this library clearly.

from uwebsockets.

uNetworkingAB avatar uNetworkingAB commented on July 17, 2024

Any single threaded library will crash if misused from different threads, or if passed invalid references.

There's an arrogance I don't need. But I can say from your fraction of program that you probably mix threads for HttpWorker (the name implies multithreaded use).

But since you only posted a fraction of your program, nobody on Earth will know or want to know.

This is not a usable bug report

from uwebsockets.

suzixin avatar suzixin commented on July 17, 2024

Thank you for pointing out this issue. It is indeed possible that multiple threads are calling the same instance's app_->publish("broadcast", message.dump(), uWS::TEXT). However, even after adding locks to protect this call, the problem persists. Could you advise on how best to utilize your internal synchronization mechanisms in this situation? I have tried reviewing the examples and documentation, but haven't found a clear approach. Any additional resources you could provide would be greatly appreciated.

from uwebsockets.

uNetworkingAB avatar uNetworkingAB commented on July 17, 2024

A lock doesn't do anything for a library that is single-threaded. The only function you can call from many threads is Loop::defer it is mentioned in readmore manual.

from uwebsockets.

Related Issues (20)

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.