Comments (7)
Another possibility is to add to the existing documentation on the event loop.
Though in that case perhaps the multithreading page could be rewritten to point at a section of the modified event loop documentation?
from janet-lang.org.
In the mean time, I've assembled / remixed a document regarding recent developments: Threading in Janet using ev.
from janet-lang.org.
Is the issue here that the current chapter on threads (multithreading) should use functions from
ev
?
In case it wasn't clear, the thread module was deprecated with the 1.17.0 release -- see the third item from the top of the CHANGELOG.md file.
If one wants to use thread stuff in Janet going forward, then I believe the thread support in ev is the recommended built-in path.
So it seems like the current page on multithreading continuing to exist in its current form doesn't communicate that message.
from janet-lang.org.
FWIW, the text I linked to is basically a rearrangement of existing material that was written by others (I think mostly bakpakin).
As I understand it "Threads in Janet" make use of (but are not the same thing as) underlying operating system thread primitives, e.g. pthreads on unixen or if on Windows whatever is used by Janet there. "Threads in Janet" are an abstraction on top of those things -- we don't get access to everything they can do (for good reasons IIUC).
from janet-lang.org.
Is the issue here that the current chapter on threads (multithreading) should use functions from ev
?
If that's the case, another option may be to create a "concurrency and parallelism" directory that contains chapters on:
- fibers (which has its own subdir docs)
- event loop
- threads
(I think I remember seeing @bakpakin write in the chat that if the function name has "thread" anywhere in it, then it's talking about actual threads (that map to native threads). Correct?)
An intro chapter in such a top-level "concurrency-and-parallelism/index.mdz" doc would be an excellent place to make some things clear from the get-go --- my understanding of these things so far is:
- fibers: for concurrency ("time-sliced"). "Scheduling" is done cooperatively (via
yield
andresume
). - threads: for parallelism (if multiple CPUs are available). Scheduling is done preemptively (by the OS). Threads in your program map directly to native (aka kernel) threads.
from janet-lang.org.
@sogaiu , in your Threading in Janet using ev doc, you write:
"Threads in Janet do not share a memory heap and must communicate via message passing using a thread channel."
My understanding is that all threads share the process's address space and resources... they all have access to the program's globals, correct? Maybe I'm confusing those things with the memory heap you mention in your doc?
from janet-lang.org.
The section has now been rewritten and this problem has been fixed.
from janet-lang.org.
Related Issues (20)
- Document on emscripten outdated HOT 3
- Auto-focusing search means you can't link to specific API functions HOT 1
- Example in "Installing a module" points at archived repository
- PEG specials `true` and `false` lack docs on PEG page HOT 2
- Related Windows instructions out-of-sync
- Bytecode reference table lacks entry for divf HOT 1
- Several (probably all) community examples links of spork functions are broken. HOT 9
- Bytecode reference table lacks entry for subim
- Non-ideal discoverability of Janet divergences from other programming languages HOT 9
- Extra dots in some operator symbols in ref table for abstract machine instructions?
- Document `&keys` better. HOT 12
- Document spork/utf8. HOT 4
- Document `init.janet` for `import`. HOT 2
- Document how to import an absolute path with `import`. HOT 8
- Document `declare-bin`. HOT 5
- Subprocess management appears under-documented HOT 2
- Identifiers with slashes / solidi can end up across multiple lines HOT 1
- The `split` PEG special lacks documentation
- Regarding keeping editor and tooling info on the front-page up-to-date HOT 15
- Docs don't mention that function literals can be named with keywords
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 janet-lang.org.