Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Alarm In Perl

by meena (Novice)
on Jul 25, 2013 at 11:44 UTC ( [id://1046323]=note: print w/replies, xml ) Need Help??


in reply to Alarm In Perl

If I want to invoke from a thread an alarm in main ,How will I achieve that, Sorry I forgot to add a sleep(3); in the thread Still it doesnot work

Replies are listed 'Best First'.
Re^2: Alarm In Perl
by ww (Archbishop) on Jul 25, 2013 at 11:58 UTC

    I. Reading perldoc -f alarm on your console might be helpful.

    II. "not working" and "doesn't work" are NOT usually useful descriptions -- are you seeing any messages about your initial error? If so, quote it. If not, at least be specific about "how" it's "not working."

    III. Did you note that your OP has been considered for code tags? If not, please do note, and return to your top post to insert the tags described at the text entry box.

    If I've misconstrued your question or the logic needed to answer it, I offer my apologies to all those electrons which were inconvenienced by the creation of this post.
Re^2: Alarm In Perl
by BrowserUk (Patriarch) on Jul 25, 2013 at 12:07 UTC
    I want to invoke from a thread an alarm in main ,How will I achieve that,

    You cannot. Any signal raised within your thread will only be seen by that thread; not main.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I want to send a message from thread to main so that some operation can be performed in the main Eg: alarm can be set in main

        I repeat: "You cannot" do so with alarm.

        Describe your overall purpose and maybe we can suggest another way of achieving it.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        This will depend on what precisely you mean by "message", but consider sockets or shared variables or signals as some things to investigate first.

        Perhaps see perlipc for starters.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1046323]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-28 12:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found