Thread: Multithreading Exercises

  1. #1
    Old Fashioned
    Join Date
    Nov 2016
    Posts
    127

    Question Multithreading Exercises

    I'm trying to gain more experience writing multithreaded code, especially with pthreads.

    Occasionally I need to do it for work, but no often enough to really improve my skills to where I'd like to be.

    Do you have any recommended small programs which could benefit from a multithreaded architecture? I've written a program which searches a bunch of text (like GBs of it) before but other than that, aside from specific work-related use-cases that pop up, I have a hard time coming up with useful small program ideas I can use to implement pthreads. Thanks.
    If I was homeless and jobless, I would take my laptop to a wifi source and write C for fun all day. It's the same thing I enjoy now!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,490
    Various sorting algorithms can be split into parallel and sequential steps.

    Various image manipulation algorithms can be split to work on tiles of the image at the same time.
    Integer scaling would be quite easy.
    Fractional scaling, involving interpolation with neighbours would be challenging at the seams between tiles.

    Fetch a web page, then use threads to fetch each resource within the page as a separate thread.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ Exercises
    By GReaper in forum C++ Programming
    Replies: 11
    Last Post: 07-17-2010, 01:22 PM
  2. exercises in c++
    By BEN10 in forum C++ Programming
    Replies: 2
    Last Post: 07-26-2008, 04:07 AM
  3. C++ Exercises
    By lasher in forum C++ Programming
    Replies: 6
    Last Post: 12-06-2006, 09:48 PM
  4. Exercises
    By blankstare77 in forum C++ Programming
    Replies: 2
    Last Post: 08-31-2005, 05:46 PM
  5. Exercises
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 10-14-2001, 11:29 AM

Tags for this Thread