Halp! Sprites! Halp!
2 posters
Page 2 of 2
Page 2 of 2 • 1, 2
Re: Halp! Sprites! Halp!
that will be ram overflow wont it?... and it wont couse program to crash cpu ...
Guest- Guest
Re: Halp! Sprites! Halp!
yep Vlad is right, endless loop that does nothing hogs up the cpu, endless loop that generates data hogs up cpu and ram and the operating system will stop it at some point when it requests too much memory.. or if the os does not stop it (bad os!) then it will simply crash or freeze cause there is no such thing as endless memory
about programming for multicores.. there are several ways of doing it, either start several processes on the os level, like prime95 does it, or do it within a single process like some games supposedly do it.
the process way is simply starting several instances of the same program, in this case an audio encoding/decoding program that is basically a math program cause it just has to calculate a lot of numbers. the audio file could be cut in two for example and both parts would be encoded at the same time, each by a separate cpu core. the biggest difficulty with this method is the handling of the data between the processes.
the way of handling mutlicore inside a single process is probably by using threads, i dont know much about binding threads to cpu cores but it will have the same basic structure, some core parts of the program will be able to run at the same time on assigned cores, and data access will happen inside program variables/objects and will have to be synchronized between the threads.
also, in this case it is important to look at the problem of audio encoding/decoding and see what gives the better performance, separating the file into several parts and let them encode simultaneously without any interaction between the processes, or making them more dependent on each other by having them exchange data all the time.
edit: i got curious about this and a quick search on google found this http://www.threadingbuildingblocks.org/ which is an open-source library from Intel that helps with helps with programming for multicores, it has a built-in task manager that automatically balances the load of the program (that has to be multithreaded) and optimally uses the cpu cores. this would be basically what one had to write without such a library, a selfmade task manager that handles the work that has to be done to the cpu cores
about programming for multicores.. there are several ways of doing it, either start several processes on the os level, like prime95 does it, or do it within a single process like some games supposedly do it.
the process way is simply starting several instances of the same program, in this case an audio encoding/decoding program that is basically a math program cause it just has to calculate a lot of numbers. the audio file could be cut in two for example and both parts would be encoded at the same time, each by a separate cpu core. the biggest difficulty with this method is the handling of the data between the processes.
the way of handling mutlicore inside a single process is probably by using threads, i dont know much about binding threads to cpu cores but it will have the same basic structure, some core parts of the program will be able to run at the same time on assigned cores, and data access will happen inside program variables/objects and will have to be synchronized between the threads.
also, in this case it is important to look at the problem of audio encoding/decoding and see what gives the better performance, separating the file into several parts and let them encode simultaneously without any interaction between the processes, or making them more dependent on each other by having them exchange data all the time.
edit: i got curious about this and a quick search on google found this http://www.threadingbuildingblocks.org/ which is an open-source library from Intel that helps with helps with programming for multicores, it has a built-in task manager that automatically balances the load of the program (that has to be multithreaded) and optimally uses the cpu cores. this would be basically what one had to write without such a library, a selfmade task manager that handles the work that has to be done to the cpu cores
Guest- Guest
Re: Halp! Sprites! Halp!
wow someones lurking in the ghostown
Lord~Hughsinkler- Lieutenant Colonel
- Location : Lord Stores Room, trying out the new nukes
Age : 31
Number of posts : 2411
Page 2 of 2 • 1, 2
Page 2 of 2
Permissions in this forum:
You cannot reply to topics in this forum