Safe Thread Queue

This is a discussion on Safe Thread Queue within the C++ Programming forums, part of the General Programming Boards category; Hello, I am new at this forum and want to thank you for this opportunity. I need to code a ...

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    3

    Safe Thread Queue

    Hello, I am new at this forum and want to thank you for this opportunity.

    I need to code a thread safe queue in C++ , BUT asked me not to use existing class libraries for this task.
    It has something like wait and notify that can I use ?

    Anyone can help me ? it is possible ?

    thanks

    Mauricio Schoenfelder
    Last edited by mauricio.sch; 01-29-2008 at 03:09 PM. Reason: Add information

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,630
    Welcome to the boards.

    Yes, it's possible. Why can't you use existing class libraries? What OS and compiler?

    gg

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    3
    It was a friend of mine, she is a professor. I don't know why can't use libraries, sorry.

    I know a little bit of C++, but don't know how to do it without libraries.

    I thank you any help

  4. #4
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,413
    Are you sure you're up for such a challenge then?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Jan 2008
    Posts
    3
    Sorry, it is for Windows and gcc
    Last edited by mauricio.sch; 01-29-2008 at 04:52 PM.

  6. #6
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,630
    Start by implementing a Queue abstract data type. Once you post the code for that, then we'll look at how to make it thread safe.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Messaging Between Threads, Exiting Thread On Demand, Etc.
    By HyperShadow in forum C++ Programming
    Replies: 10
    Last Post: 06-09-2007, 01:04 PM
  2. ADT queue
    By ^xor in forum C Programming
    Replies: 4
    Last Post: 06-15-2005, 05:43 AM
  3. [code] Win32 Thread Object
    By Codeplug in forum Windows Programming
    Replies: 0
    Last Post: 06-03-2005, 03:55 PM
  4. multithreading question
    By ichijoji in forum C++ Programming
    Replies: 7
    Last Post: 04-12-2005, 10:59 PM
  5. help with queues
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 05-21-2002, 09:09 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21