Results 1 to 7 of 7
  1. #1
    JDCAce's Avatar
    JDCAce is offline Member
    Join Date
    Oct 2008
    Location
    Columbus, GA, US
    Posts
    29
    Rep Power
    0

    Default Alarm Clock - Simple Question

    My laptop lacks an alarm function, which I would like. I have a simple question to ask before I decide to make one myself: Is it feasible to build a program that runs on a computer constantly (or just for a really long time)? Would a Java clock take up too much processing power? Would my computer be able to function normally if the program runs indefinitely?
    "Things are made of littler things that jiggle."

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default

    Is this an assignment masked as a need? If so , please be upfront about it.

    If not, there are free downloads available for this. I use Clock G2, which provides multiple time zones, multiple alarms and text to speech.

    db

  3. #3
    JDCAce's Avatar
    JDCAce is offline Member
    Join Date
    Oct 2008
    Location
    Columbus, GA, US
    Posts
    29
    Rep Power
    0

    Default

    No, this is strictly a desire (I don't need a clock, but it's definitely not an assignment). I am in a Java class, but I am so far ahead of everybody else, I could probably take the final tomorrow and ace it. Anyway, I like to code in my spare time, but I never know what kind of application I want to make. I've finally decided upon an alarm clock. Downloading one would quench my desire for one, but it wouldn't quench my desire to code. I'll check out Clock G2 nonetheless. Thanks!
    "Things are made of littler things that jiggle."

  4. #4
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    Quote Originally Posted by JDCAce View Post
    Is it feasible to build a program that runs on a computer constantly (or just for a really long time)? Would a Java clock take up too much processing power? Would my computer be able to function normally if the program runs indefinitely?
    1) Yes, the normal term of art is daemon. or 'service' in the Windoze world. You can write a daemon in any language.

    3) yes, if you implement it properly

    2) Depends on how you design it. A clock should mostly be asleep. Normal design is to have two threads, one that sleeps and wakes up periodically, and one that displays the current time when its has changed.

    This can be a good assignment, you can learn about Barrier and threads, and synchronization.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    fishtoprecords: I haven't run across the term "barrier" with regards to programming or Java. My Google search suggests that this has something to do with synchronization, with allowing threads to wait for a condition,... is this right? Is this implemented out of the box by Java? Thanks!

  6. #6
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    java.util.concurrent.CyclicBarrier

    java.util.concurrent.CountDownLatch


    You should check out the Java Tutorial on concurrancy that was added to Java in 1.5

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Simple question about access
    By tortelini in forum New To Java
    Replies: 6
    Last Post: 09-06-2008, 05:41 PM
  2. Simple Method Question
    By Froz3n777 in forum New To Java
    Replies: 2
    Last Post: 02-13-2008, 02:39 AM
  3. Simple append question
    By Rageagainst20 in forum New To Java
    Replies: 0
    Last Post: 12-20-2007, 11:40 PM
  4. Probably a really simple question...
    By ibanez270dx in forum New To Java
    Replies: 0
    Last Post: 11-16-2007, 01:27 AM
  5. Simple question of JTable
    By carl in forum AWT / Swing
    Replies: 1
    Last Post: 08-07-2007, 07:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •