List of commits:
Subject Hash Author Date (UTC)
Fix module concurrency. f39efe6c3981d1097e6ee8ced0f3d7a8c913a256 Jan Allersma 2019-01-20 14:46:26
Revise git(ignore) integration. 192f93a160ead0165ca15c21f5cc046d89b7ba5d Jan Allersma 2019-01-19 16:39:10
Run modules concurrently. 0100f680f4054ffe4948278a5dae93b4fcb0d333 Jan Allersma 2019-01-19 16:24:27
Fix `dep_config::scan`. ed8759345a07e93b30bd802b1e6ecb8d5eeb3b85 Jan Allersma 2019-01-18 14:53:50
Fix fetching with single-file-modules. d1a2173433bf45648da9a85cda04d7ace9148439 Jan Allersma 2019-01-15 16:24:27
Add feature: initialize hidden dependencies. fc99666c48da1653b3097a0251d8219bc49886cb Jan Allersma 2019-01-12 15:52:45
Revise `hide` command. 482bad08f949eaedbd61e2cb7c53870271d47997 Jan Allersma 2019-01-11 15:45:26
Rename project to 'Ambassade'. 4f9c0e27ca25042a97acebc9f3282e4f941706fe Jan Allersma 2019-01-10 15:01:39
Git integration. 0ebc5b3769e50c3463bdc39af0160c7db0d3f00b Jan Allersma 2019-01-03 17:34:18
Implement `hide` command. ab693b8fd91c93dfd7ee7b82cbae75b2a6043b0f Jan Allersma 2018-12-29 15:13:25
Resolve missing/erroneous build/run commands. e81d57882036a6475718b0653169c609d23b1c30 Jan Allersma 2018-12-25 13:06:00
Show working directory in status. ab188603dda062de4b2ea76c5bc1d2d41d98b8c2 Jan Allersma 2018-12-25 10:36:35
Add shell fallthrough. 02078135791fb3889152c11defaa2df21d0ae597 Jan Allersma 2018-12-22 19:47:36
Show dependencies when using `delete` command. cfa9779714d5e6d46ab5b4eeb84a915a15f23f54 Jan Allersma 2018-12-20 15:46:05
Resolve dep-tree by building project recursively. f53e38d790ec67d99ec8204af97273a53b73a9dc Jan Allersma 2018-12-19 14:54:07
Improve `dep-tree` command. 90bfa0340b7b874d65c08dc05c3d711abda1c469 Jan Allersma 2018-12-17 20:10:14
Implement experimental `dep-tree` command. 45d9dfdbfc99c59174e7c587621276b78ab7a4e9 Jan Allersma 2018-12-14 16:11:53
Implement `add` command. bbb2544bd06f29866465d651c32ca4d6e017f5e9 Jan Allersma 2018-12-11 15:43:10
Implement `exe` command. 1eaa36242201cf7ade5f23a14340e630c267db07 Jan Allersma 2018-12-11 13:23:32
Implement `run` and `build` commands. 14e9e25b6a06f587c1a50829e72c829ae59a87c2 Jan Allersma 2018-12-10 20:57:08
Commit f39efe6c3981d1097e6ee8ced0f3d7a8c913a256 - Fix module concurrency.
The threads where joining before they actually ran. The `Threadhandler` is now waiting for all modules to finish their threads before they join.
Author: Jan Allersma
Author date (UTC): 2019-01-20 14:46
Committer name: Jan Allersma
Committer date (UTC): 2019-01-20 14:58
Parent(s): 192f93a160ead0165ca15c21f5cc046d89b7ba5d
Signing key:
Tree: 7294e93fd4e9150c209f8affc3fec1b07b3066f1
File Lines added Lines deleted
README.md 0 2
src/backend/internal/paralellism.rs 24 3
File README.md changed (mode: 100644) (index da55583..e1dd235)
3 3 ## Notes ## Notes
4 4
5 5 `backend::fetch::update_module()` kan wellicht met `backend::add::update_module()` samengevoegd worden. `backend::fetch::update_module()` kan wellicht met `backend::add::update_module()` samengevoegd worden.
6
7 Een threadpool om iedere dep apart mee te runnen.
File src/backend/internal/paralellism.rs changed (mode: 100644) (index 6d40548..09becef)
1 1 use backend; use backend;
2 2 use std::thread; use std::thread;
3 use std::sync::Arc;
4 use std::sync::atomic::{AtomicUsize, Ordering};
3 5 use std::result::Result; use std::result::Result;
4 6 use std::path::PathBuf; use std::path::PathBuf;
7 use std::time::Duration;
5 8
6 9 type FetchPtr = fn(String, PathBuf, String) -> Result<String, String>; type FetchPtr = fn(String, PathBuf, String) -> Result<String, String>;
7 10
 
... ... impl Threadhandler {
40 43 } }
41 44
42 45 pub fn start(&mut self) { pub fn start(&mut self) {
43 let mut handles = vec![];
44
45 46 if self.triggered { if self.triggered {
46 47 println!("{}", "Threadhandler already started."); println!("{}", "Threadhandler already started.");
47 48 return return
48 49 } }
49 50
50 51 self.triggered = true; self.triggered = true;
52 let mut handles = vec![];
53 let running_jobs = Arc::new(AtomicUsize::new(0));
54
51 55
52 56 for job in self.jobs.clone() { for job in self.jobs.clone() {
53 57 println!("Thread: {:?}", &job); println!("Thread: {:?}", &job);
54 let handle = thread::spawn(|| job.0(job.1, job.2, job.3));
58 running_jobs.fetch_add(1, Ordering::Release);
59 let running_jobs = Arc::clone(&running_jobs);
60
61 let handle = thread::spawn(move|| {
62 match &job.0(job.1.clone(), job.2.clone(), job.3.clone()) {
63 Ok(msg) => println!("{}", msg),
64 Err(e) => println!("Thread {:?} paniced. Details: {}", &job, e)
65 }
66
67 running_jobs.fetch_sub(1, Ordering::Relaxed);
68 });
69
55 70 handles.push(handle); handles.push(handle);
56 71 } }
57 72
58 73 println!("All scheduled jobs are running! Waiting for job to finish.."); println!("All scheduled jobs are running! Waiting for job to finish..");
59 74
75 while running_jobs.load(Ordering::Relaxed) != 0 {
76 thread::sleep(Duration::from_secs(3));
77 }
78
60 79 for handle in handles { for handle in handles {
80 println!("Join handle..");
61 81 handle.join().unwrap(); handle.join().unwrap();
82 println!("Handle joined.");
62 83 } }
63 84 } }
64 85 } }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/kapstok/NHL-Beheer

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/kapstok/NHL-Beheer

Clone this repository using git:
git clone git://git.rocketgit.com/user/kapstok/NHL-Beheer

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main