<commit_before>#include <iostream>
#include <vector>
#include <math.h>
using namespace std;

double x0,x1,x2,s2,c2;

/////////////////////////////
struct engine; 
struct proc; 
struct chan; 
 
struct engine{ 
	std::vector<chan*> ready; 
}; 
 
struct proc{ 
	void(*recv)(chan*, proc*); 
}; 
 
struct chan{ 
	proc*p; 
 	bool sending; 
}; 
 
inline void send(engine*e, chan*c, proc*p) 
{ 
	if (c->sending) return; 
 	c->sending = true; 
 	c->p = p; 
 	e->ready.push_back(c); 
} 
 
inline bool access(chan*c, proc*p) 
{ 
	return c->p == p && !c->sending; 
} 
 
inline void run(engine*e, int n = 1) 
{ 
	size_t rsize; 
	while (rsize = e->ready.size()){ 
 		int n = rand() % rsize;	
		std::vector<chan*>::const_iterator it = e->ready.begin() + n; 
 		chan*c = *it;	e->ready.erase(it); c->sending = false; 
 		c->p->recv(c, c->p); 
	} 
} 

/////////////////////////////
/*
~Link= 
 	+Begin ? argSin2 -> Calc | argCos2 -> Calc; 
 	 Calc  ! result  -> End; 
 	 End. 
*Parent= 
 	 p1 : Link ! result -> join; 
 	 p2 : Link ! result -> join; 
 	+fork(p1!argCos2,p2!argSin2); 
 	 join(p1?result,p2?result). 
*Child= 
 	p : Link ? argCos2 -> calcCos2 | argSin2 -> calcSin2; <commit_msg>move from dbg to seq runtime<commit_after>#include <iostream>
//#include <vector>
#include <queue>
#include <math.h>

using namespace std;

double x0,x1,x2,s2,c2;

/////////////////////////////
struct engine; 
struct proc; 
struct chan; 
 
struct engine{ 
	//std::vector<chan*> ready;
	std::queue<chan*> ready;
}; 
 
struct proc{ 
	void(*recv)(chan*, proc*); 
}; 
 
struct chan{ 
	proc*p; 
 	bool sending; 
}; 
 
inline void send(engine*e, chan*c, proc*p) 
{ 
	if (c->sending) return; 
 	c->sending = true;	c->p = p; 
 	e->ready.push(c); 

//	if (c->sending) return; 
// 	c->sending = true; 
// 	c->p = p; 
// 	e->ready.push_back(c); 
} 
 
inline bool access(chan*c, proc*p) 
{ 
	return c->p == p && !c->sending; 
} 
 
inline void run(engine*e, int n = 1) 
{ 
 	while (!e->ready.empty()){ 
 		chan*c = e->ready.front(); e->ready.pop(); 
 		c->sending = false; 
 		c->p->recv(c, c->p); 
 	} 
/* 
	size_t rsize; 
	while (rsize = e->ready.size()){ 
 		int n = rand() % rsize;	
		std::vector<chan*>::const_iterator it = e->ready.begin() + n; 
 		chan*c = *it;	e->ready.erase(it); c->sending = false; 
 		c->p->recv(c, c->p); 
	}
*/
} 

/////////////////////////////
/*
~Link= 
 	+Begin ? argSin2 -> Calc | argCos2 -> Calc; 
 	 Calc  ! result  -> End; 
 	 End. 
*Parent= 
 	 p1 : Link ! result -> join; 
 	 p2 : Link ! result -> join; 
 	+fork(p1!argCos2,p2!argSin2); 
 	 join(p1?result,p2?result). 
*Child= 
 	p : Link ? argCos2 -> calcCos2 | argSin2 -> calcSin2; 
{'fraction_non_alphanumeric': 0.23319407519939234, 'fraction_numerical': 0.015191796429927839, 'mean_word_length': 2.398709677419355, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 66, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '93198', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1089, 'n_words': 236}