Giter Site home page Giter Site logo

Comments (5)

cbakgly avatar cbakgly commented on July 3, 2024

Oh, this hurts :'(. But I agree somehow, if you have a better idea with less effort.

from crossbridge.

liaocheng avatar liaocheng commented on July 3, 2024

Hi, if you embed the assets to the main swf, it's really hard to separate the assets from the main swf because we just simply creates a new worker as a thread by passing the whole main swf into "createWorker" function

from crossbridge.

mbolt35 avatar mbolt35 commented on July 3, 2024

Thanks for your responses. I did notice that if I use a web based VFS, because those assets are downloaded at runtime, they're not copied into each Worker. This is better, but it still makes little sense to me why a pthread created via c++ code would ever need any of the inital swf data copied into the worker. I was under the impression that any inline AS3, file io, etc.. was all marshalled back to the main thread, which would mean the data copied into the Worker is never used, and the overhead for a thread increases with the size of the SWF. From a quick glance at the code, it appears that the main application loader bytes are used because it already has the "receiver" code compiled for communicating back to the main thread in regards to the domain memory.

If the above reason is the only reason why this is done, wouldn't it be much more efficient to create a lightweight SWF containing only what was needed to communicate with the main thread, and nothing else? Then, re-use that SWF as the basis for creating new "pthreads"?

Edit: I forgot about the AS3::local namespace which will use the current thread context for as3 interop. While I think it's a good feature to have, perhaps it should be configurable as a build option. It might just be my narrow perspective, but I can think of many cases where threads are more likely to be useful sharing domain memory, rather than sharing copied AS3 objects.

from crossbridge.

inspirit avatar inspirit commented on July 3, 2024

i totally agree that threads created on native side is usually used for some processing relying on shared memory only and do not use any of as3 objects at all...

from crossbridge.

rtissera avatar rtissera commented on July 3, 2024

I totally agree this is a show-stopper for me on using pthreads in Crossbridge.

from crossbridge.

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.