tag:blogger.com,1999:blog-3205414380859703216.post423441419286734287..comments2023-08-05T08:26:33.769-07:00Comments on F# for game development: Things that don't work on XboxJohann Deneuxhttp://www.blogger.com/profile/11997760819395618904noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-3205414380859703216.post-70185038064611138582010-03-30T21:37:33.711-07:002010-03-30T21:37:33.711-07:00@Joh
Silly me, I've made such a stupid mistak...@Joh<br /><br />Silly me, I've made such a stupid mistake...<br /><br />Yes, it seems that I was wrong and there's no difference between running task in thread pool or running part of it in main thread. Sorry.<br /><br />Here's corrected version for using ThreadPool:<br /><br />http://pastebin.com/c0Q9zmqp<br /><br />and one using async delegates<br /><br />http://pastebin.com/bMHNJakz<br /><br />They show that async delegates (strangely enough) perform slightly better, but it is largely insignificant.<br /><br />It would be interesting to know how this approaches will work on XBox's CLR and will their performance differ.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3205414380859703216.post-77879849592932400542010-03-30T13:53:54.620-07:002010-03-30T13:53:54.620-07:00I did not understand what the code on pastebin was...I did not understand what the code on pastebin was supposed to demonstrate.<br /><br />The first experiment measures the computation time on the full array.<br /><br />The second experiment measures the computation time on the first half of the array, using one thread from the thread pool.<br /><br />The last experiment measures the time on both halves, using two threads, each working on its own half.<br /><br />Is the second experiment as intended?Johann Deneuxhttps://www.blogger.com/profile/11997760819395618904noreply@blogger.comtag:blogger.com,1999:blog-3205414380859703216.post-48047389178446779712010-03-30T02:54:10.931-07:002010-03-30T02:54:10.931-07:00ThreadPool.QueueUserWorkItem guarantees that deleg...ThreadPool.QueueUserWorkItem guarantees that delegate will be executed in a thread different from main. It doesn't guarantee that each passed delegate will be executed in parallel.<br /><br />Have a look at this program http://pastebin.com/gHdWZh1s, for example.<br /><br />AFAIK, async delegates don't have this problem.Anonymousnoreply@blogger.com