Comments (5)
Oh, this hurts :'(. But I agree somehow, if you have a better idea with less effort.
from crossbridge.
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.
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.
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.
I totally agree this is a show-stopper for me on using pthreads in Crossbridge.
from crossbridge.
Related Issues (20)
- Merge codebase to the official SWIG project HOT 3
- Cannot build master branch on Windows platform using Cygwin HOT 6
- Cannot build master branch on Mac platform using Travis-CI HOT 2
- getting started HOT 7
- Building the SDK HOT 1
- pthreads and workers support HOT 10
- getting started HOT 17
- performance aspects of crossbridge code HOT 2
- GDB. HOT 1
- fopen with directories makes fseek throw HOT 2
- PlayerKernel.open() throws exception when opening ISpecialFile file with O_TRUNC
- Cygwin dll files is missing HOT 1
- simple app used flashcc socket throws 'terminate called after throwing an instance of 'AS3::ui::var'' HOT 1
- Can't get it to work with SFML
- how do i link a static lib which build by cygwin HOT 1
- Use crossbridge to compile client.c to swc but failed because of a link error HOT 1
- gcc in cygwin is not support windows 10
- archive project? HOT 4
- crossbridge and C++11 HOT 10
- Disable output in adl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crossbridge.