multithreading - API Design for Task/Parallelization Library -


I have just completed an important revision of my task pool / paralysis library for D programming language. I am interested in critics It is, especially by those who are not regular D of regular users, but want to know the decent amount about the use of such a library I would like to save from the group's ink which is only for the sake of its vote. Yogkrtaon will be made by asking relatively small community opinion.

  1. Do you think the API is not engineered at the right level, that is, ridiculously more or futile?

  2. Do you think the documentation is quite clear that anyone who is not already a D master, use it?

  3. Do you think there are any major missing features that should be added or the useless features should be removed?

  4. Do you think this is a good design?

Disclaimer: maybe staying around with D 2.0 for 10 days (Tick "Do not use D regularly") I consider it an opportunity to learn something about D.

Regarding 1 and 2: Easy to read and understand ( article ("sum =", myFuture.spinWait, for example, probably "Yoga =", myTask.spinWait ()); .

About 3: One would be good and I had enough information about D But I think that mutes are defined anywhere.

About 4: Your design indicates that you have a worker pool, A thread's good The pairs, and the threads then steal the work from this pool. Now, I have debunked the part of my own obstacles (mostly my own creation). Apart from NUMA and "judiciously" sorting things with the help of mutes With that, pools can also be "successful" in order to sort your program and start overhead. I think the API can not stop a good implementation. I just wonder. : Why does the map, less, parallel_for functions? Are these methods propose?

Edit: I have played with my library, and it is good to calculate most and It's well-scalable for handling less memory usage (relative to hand-coded threading) I already repeat the two suggestions:

  1. I have algorithms (data parity) and Consider separating work groups (work parallelism) Rega. This will come closer to this more common C ++ library (TBB, OpenMP, MS PPL and TPL). Apart from the perspective of implementation: You may want to schedule data contemplation without working groups in future (such as GPU bound) or use additional information (such as memory layout).

  2. It already means that the scheduler can be made independent of the workforce. Apart from this, I would also consider scheduler making a singleton. Some libraries control program-wide resources, such as memory and processors. Intel says why scheduler is a singleton:

For example, garbage control controls memory allocation. Conformity, TBB determines work in a program. To do your work effectively, each of these should be a singleton; [...] By allowing Kashmir instances of TBB scheduler in a program, K will have many software threads in the form of hardware threads. This program will work inefficiently, because the machine will be oversized by a component of Kashmir, which will cause more reference switching, cash contamination, and memory consumption.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -