Coder Social home page Coder Social logo

Comments (3)

flesler avatar flesler commented on August 20, 2024 1

Right, also the states are potentially large JSON objects, not just arrays of numbers or bytes that you can optimize for. It's a hard one now that I think of, seems like all the simulation code and Macao integration functions need to be in a worker module and Macao calls it. So the user needs to put their code in a separate module explicitly, it's a more complex API and requirements no doubt

from macao.

flesler avatar flesler commented on August 20, 2024

Maybe this helps. Here's a pretty simple example of a server and browser workers that receive a large list of numbers and return some back.
https://github.com/wagenaartje/neataptic/tree/master/src/multithreading/workers

from macao.

snowfrogdev avatar snowfrogdev commented on August 20, 2024

@flesler I've hit a bit of a wall when it comes to multithreading Macao and it has to do with the way Workers and Node child_processes work. The main problem I'm having is that Macao's algorithm requires the Macao user to supply functions that allow Macao to 'play' the game. For multithreading to work, I have to find a way to pass these functions from the main thread to other threads. The problem is that multithreading in JS does not share memory and is done thru serialized message passing and you can't serialize a function, ergo I can't pass the functions to other threads. I have yet to find a solution. Do you have any ideas?

from macao.

Related Issues (11)

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.