Skip to main content
bullets
Source Link
Martin Wickman
  • 13.4k
  • 3
  • 33
  • 66

Not to my knowledge, it seems extremely hard to get right. Even if you could do it, you still have to consider system load, number of cores, other os activities etc.

A simplistic idea: would it be possible to start the calculation and simply wait until a certain time has passed and then move it to a separate thread, once you realize this calcuation is not trivial?

Have you considered a pool of threads or a dispatch queue? At least that allows you avoid some issues with context switching etc and youSome alternative approaches I can balance the system as a whole dynamically based on the total amountthink of usage and jobs.:

Are the jobs arbitrary blocks of code or can you model them as map-reduce problems or some other way that separates input data from code? That way you could calculate how hard a problem is based on data input size and throughput for each item. After a bunch of samples you should be able to determine how much time it should take in total for the calculation to complete, and thus decide to run it locally or distributed.

  • Have you considered a pool of threads or a dispatch queue? At least that allows you avoid some issues with context switching etc and you can balance the system as a whole dynamically based on the total amount of usage and jobs.

  • Can you model the calculations as map-reduce problems (or otherwise separate input data from code)? Then you could calculate how hard a problem is based on input data size and throughput for each item. After a bunch of samples you should be able to determine how much time it should take in total for the calculation to complete, and thus decide to run it locally or distributed.

  • Would it be possible to start the calculation and simply wait until a certain time has passed and then move it to a separate thread, once you realize this calculation is not trivial?

Not to my knowledge, it seems extremely hard to get right. Even if you could do it, you still have to consider system load, number of cores, other os activities etc.

A simplistic idea: would it be possible to start the calculation and simply wait until a certain time has passed and then move it to a separate thread, once you realize this calcuation is not trivial?

Have you considered a pool of threads or a dispatch queue? At least that allows you avoid some issues with context switching etc and you can balance the system as a whole dynamically based on the total amount of usage and jobs.

Are the jobs arbitrary blocks of code or can you model them as map-reduce problems or some other way that separates input data from code? That way you could calculate how hard a problem is based on data input size and throughput for each item. After a bunch of samples you should be able to determine how much time it should take in total for the calculation to complete, and thus decide to run it locally or distributed.

Not to my knowledge, it seems extremely hard to get right. Even if you could do it, you still have to consider system load, number of cores, other os activities etc.

Some alternative approaches I can think of:

  • Have you considered a pool of threads or a dispatch queue? At least that allows you avoid some issues with context switching etc and you can balance the system as a whole dynamically based on the total amount of usage and jobs.

  • Can you model the calculations as map-reduce problems (or otherwise separate input data from code)? Then you could calculate how hard a problem is based on input data size and throughput for each item. After a bunch of samples you should be able to determine how much time it should take in total for the calculation to complete, and thus decide to run it locally or distributed.

  • Would it be possible to start the calculation and simply wait until a certain time has passed and then move it to a separate thread, once you realize this calculation is not trivial?

added 169 characters in body
Source Link
Martin Wickman
  • 13.4k
  • 3
  • 33
  • 66

Not to my knowledge, it seems extremely hard to get right. Even if you could do it, you still have to consider system load, number of cores, other os activities etc.

A simplistic idea: would it be possible to start the calculation and simply wait until a certain time has passed and then move it to a separate thread, once you realize this calcuation is not trivial?

Have you considered a pool of threads or a dispatch queue? At least that allows you avoid some issues with context switching etc and you can balance the system as a whole dynamically based on the total amount of usage and jobs.

Are the calculationsjobs arbitrary blockblocks of code or can you model them as a map-reduce problem,problems or some other way that separates input data from code? That way you could calculate how hard a problem is based on data input size and sample the throughput for each item. After a bunch of samples you should be able to determine how much time it should take in total for the calculation to complete, and thus decide to run it locally or distributed.

Not to my knowledge, it seems extremely hard to get right. Even if you could do it, you still have to consider system load, number of cores, other os activities etc.

A simplistic idea: would it be possible to start the calculation and simply wait until a certain time has passed and then move it to a separate thread, once you realize this calcuation is not trivial?

Have you considered a pool of threads or a dispatch queue? At least that allows you avoid some issues with context switching etc and you can balance the system as a whole dynamically based on the total amount of usage and jobs.

Are the calculations arbitrary block of code or can you model them as a map-reduce problem, or some other way that separates input data from code? That way you calculate how hard a problem is based on input size and sample the throughput for each item.

Not to my knowledge, it seems extremely hard to get right. Even if you could do it, you still have to consider system load, number of cores, other os activities etc.

A simplistic idea: would it be possible to start the calculation and simply wait until a certain time has passed and then move it to a separate thread, once you realize this calcuation is not trivial?

Have you considered a pool of threads or a dispatch queue? At least that allows you avoid some issues with context switching etc and you can balance the system as a whole dynamically based on the total amount of usage and jobs.

Are the jobs arbitrary blocks of code or can you model them as map-reduce problems or some other way that separates input data from code? That way you could calculate how hard a problem is based on data input size and throughput for each item. After a bunch of samples you should be able to determine how much time it should take in total for the calculation to complete, and thus decide to run it locally or distributed.

Source Link
Martin Wickman
  • 13.4k
  • 3
  • 33
  • 66

Not to my knowledge, it seems extremely hard to get right. Even if you could do it, you still have to consider system load, number of cores, other os activities etc.

A simplistic idea: would it be possible to start the calculation and simply wait until a certain time has passed and then move it to a separate thread, once you realize this calcuation is not trivial?

Have you considered a pool of threads or a dispatch queue? At least that allows you avoid some issues with context switching etc and you can balance the system as a whole dynamically based on the total amount of usage and jobs.

Are the calculations arbitrary block of code or can you model them as a map-reduce problem, or some other way that separates input data from code? That way you calculate how hard a problem is based on input size and sample the throughput for each item.