acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa__parallelization.h
1#pragma once
2
3
4// class task;
5
6
7
8
9// #ifdef PARALLELIZATION_PTHREAD
10
11
12// #if defined(__ANDROID__)
13
14
15// //#define MUTEX_COND_TIMED
16// #undef MUTEX_NAMED_POSIX // as of 2016-11-26
17// // not implemented (err=38) on android-19 (POSIX semaphore)
18// #define MUTEX_NAMED_FD
19// #undef MUTEX_NAMED_VSEM
20
21// #elif defined(__APPLE__) || defined(FREEBSD)
22
23// //#define MUTEX_COND_TIMED
24// #undef MUTEX_NAMED_POSIX
25// #define MUTEX_NAMED_FD // File Descriptor "Semaphore"
26// #undef MUTEX_NAMED_VSEM
27
28// #elif defined(LINUX)
29
30// //#define MUTEX_COND_TIMED
31// #undef MUTEX_NAMED_POSIX
32// #undef MUTEX_NAMED_FD
33// #define MUTEX_NAMED_FD // File Descriptor "Semaphore"
34// //#define MUTEX_NAMED_VSEM // system() V Semaphore
35// #undef MUTEX_NAMED_VSEM
36
37// #elif defined(FREEBSD)
38
39// //#define MUTEX_COND_TIMED
40// #undef MUTEX_NAMED_POSIX
41// #undef MUTEX_NAMED_FD
42// #define MUTEX_NAMED_FD // File Descriptor "Semaphore"
43// //#define MUTEX_NAMED_VSEM // system() V Semaphore
44// #undef MUTEX_NAMED_VSEM
45
46// #else
47
48// #error "Operating system not supported..."
49
50// #endif
51
52// #endif
53
54
55// class synchronization;
56// class semaphore;
57// class happening;
58// class critical_section;
59// class single_lock;
60// class multi_lock;
61
62
63
64
65//namespace parallelization
66//{
67//
68//
69// namespace array
70// {
71//
72// template < typename ARRAY >
73// ::pointer<::matter>is_running(ARRAY & array, const ::scoped_string & scopedstrTag)
74// {
75//
76// for (::collection::index i = 0; i < array.get_size(); i++)
77// {
78//
79// ::pointer<::matter>pparticle;
80//
81// pparticle = &__typed(array[i]);
82//
83// if (pparticle && pparticle->is_thread())
84// {
85//
86// if (pparticle->should_run())
87// {
88//
89// if (pparticle->get_tag().compare(scopedstrTag) == 0)
90// {
91//
92// return pparticle;
93//
94// }
95//
96// }
97//
98// }
99//
100// }
101//
102// return nullptr;
103//
104// }
105//
106//
107// }
108//
109//
110//} // namespace parallelization
111
112
113
114
115
116
117typedef void (*__THREADPROC)(void *);
118
119
120
121class tool_task;
122class task_tool;
123class thread_tools;
124//class thread_toolset;
125//class predicate_set;
126//class replace_thread;
127
128
129class thread_startup;
130
131
132
133
134class sync_interface;
135class synchronous_lock;
136class synchronous_lock;
137
138
139//class CLASS_DECL_ACME thread_ptra :
140// virtual public pointer_array < thread >
141//{
142//public:
143//
144//
145// thread_ptra();
146// thread_ptra(const thread_ptra & ptra):pointer_array < thread >(ptra) {}
147// thread_ptra(thread_ptra && ptra) :pointer_array < thread >(::transfer(ptra)) {}
148// virtual ~thread_ptra();
149//
150// virtual ::collection::count get_count_except_current_thread();
151// virtual void finish();
152// virtual void wait(const duration & duration, ::synchronous_lock & synchronouslock);
153//
154// thread_ptra & operator = (const thread_ptra & ptra) { pointer_array < thread >::operator =(ptra); return *this; }
155// thread_ptra & operator = (thread_ptra && ptra) { pointer_array < thread >::operator =(::transfer(ptra)); return *this; }
156//
157//};
158
159
160//#include "acme/platform/predicate_holder.h"
161//
162//
163//#include "synchronization.h"
164//#include "synchronization_array.h"
165//#include "semaphore.h"
166//#include "mutex.h"
167//#include "happening.h"
168//#include "set_event_on_exit.h"
169//#include "critical_section.h"
170//#include "condition_variable.h"
171//#include "condition.h"
172//#include "socket_event.h"
173//#include "single_lock.h"
175//#include "initial_single_lock.h"
176//#include "synchronous_lock.h"
179//
182//
183//
184//CLASS_DECL_ACME ::pointer<mutex>open_mutex(::matter * pmatter, const_char_pointer pszName);
185//
186//
187//#ifdef ___ENABLE_INLINES
188//#define inline inline
189//#include "_impl.h"
190//#undef inline
191//#endif
192//
193//
194//#include "manual_reset_happening.h"
195//
196//
197//#include "counter.h"
198//
199//
200//#include "acme/platform/implementable.h"
201//
202//
203//#include "acme/parallelization/task.h"
204//
205//
206//#include "acme/parallelization/task_keep.h"
207//
208//
209//#include "acme/parallelization/task_payload.h"
210//
211//
212//namespace windowing
213//{
214//
215// class window;
216//
217//} // namespace windowing
218//
219//
220//CLASS_DECL_ACME void post_message(::windowing::window * pwindow, ::enum_message emessage, ::wparam wparam, ::lparam lparam);
221//
222//
223//class thread;
224//
225//
226//
227//CLASS_DECL_ACME::task* get_task();
228//CLASS_DECL_ACME void set_task(task * ptask);
229//CLASS_DECL_ACME void thread_release();
230//
231//
232//
233//#ifdef __cplusplus_winrt
234//
235//#include "acme/operating_system/universal_windows/parallelization_winrt.h"
236//
237//#endif
238//
239//
240//string get_task_name(htask htask);
241//
242//
243//typedef string GET_THREAD_NAME(::thread* pthread);
244//
245//using LPFN_GET_THREAD_NAME = GET_THREAD_NAME*;
246//
247//CLASS_DECL_ACME void set_get_thread_name(LPFN_GET_THREAD_NAME);
248//string get_task_name(::thread* pthread);
249//
250//CLASS_DECL_ACME void thread_name_abbreviate(string & strName, ::i32 len);
251//
252//
253//CLASS_DECL_ACME::pointer < ::mutex >& message_dispatch_mutex();
254//
255//
256//
257//#ifdef WINDOWS
258//
259//inline bool wait(synchronization* psync, const duration& duration = duration::infinite())
260//{
261// return psync->wait(duration);
262//}
263//
264//void wait(::i32 numberOfItems, synchronization* psync, const duration& duration = duration::infinite(), bool waitForAll = false);
265//
266//#else
267//
268//void wait(synchronization* psynchronizationobject, const duration& duration = duration::infinite());
269//
270//void wait(size_t numberOfItems, synchronization** psynchronizationobject, const duration& duration = duration::infinite(), bool waitForAll = false);
271//
272//#endif
282//CLASS_DECL_ACME bool task_sleep(const class ::wait & wait);
283//
284//
286//
287//
288//#include "synchronized_process.h"
289//
290//
291//#include "acme/prototype/promise/signalization.h"
292//
293//
294//#include "acme/platform/synchronized_predicate_routine.h"
295//
Definition synchronous_lock.h:13
Definition tools.h:86
Definition tools.h:27