Giter VIP home page Giter VIP logo

concurrency's People

Contributors

agfeldman avatar aldenrogers avatar alphaz99 avatar codyhan94 avatar emprice avatar jeffreyan11 avatar mary-do avatar

Watchers

 avatar  avatar  avatar

concurrency's Issues

Update "Helpful hints" section

We should update the following section of the assignment, since we use std::thread now.

And, I'm not sure if the "You cannot call a member function from a thread directly" comment is still true. If it isn't, perhaps we should remove this hint entirely.


Helpful hints

You cannot call a member function from a thread directly; if this is something you would like to do, you will need to wrap it in a non-class function first, like this:

class Foo
{
    Foo() { }
    ~Foo() { }

    void f() { /* Do something interesting here. */ }
};

void *f_wrapper(void *arg)
{
    Foo *fptr = (Foo *) arg;
    fptr->f();
}

Foo *f = new Foo();
Thread *t = new Thread();
t->run(f_wrapper, (void *) f);

Make memcheck optional, and make multithreaded raytracing more sophisticated

Changes to assignment writeup as discussed in TA meeting 2016/2/19:

The make memcheck produces output that is tedious to interpret, and it is not very helpful because avoiding memory leaks in student-written code is not a big challenge in this section.

Instead, we should

  • Provide make memcheck as an optional tool; students are still responsible for not leaking memory, but are not encouraged to use make memcheck
  • Have students run raytracing in N threads instead of 2 threads (where N is a variable).
  • We could consider adding analysis questions after the N threads task. Examples to consider:
    • "Run your code with different values of N, observe how performance scales on your machine, and provide 2 or more speculations about why it might scale this way." (1 point or 2 points; I want them to actually run it on their machines, but I don't want them to spend too much time writing up their speculations.)
    • "Suppose that it is much more computationally intensive to trace some rays that to trace other rays (for example, if some rays bounce of of many more objects than other rays). How might an approach similar to a producer-consumer queue provide a performance improvement over an approach that assigns an equal number of rays to each thread? Your answer need not exceed M sentences (where M is determined by a concise reference answer).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.