Difference between wait() and sleep()

hi
can any one tell me what is the difference between wait() and sleep().
thanks in advance.

Mahaboob,
This question has been asked before; however, I will give you a real life example.
Imagine you are in a super market and you go to the till to pay by your card, then behind you there are 10 people waiting in queue. You card does not work since you have not supplied the right pin code; there are two option
1- Sleep
2- Wait
1- If you sleep you will lock the till for your self and try to figure out the pin number while the queue behind you increase on the resource (till)
so you are engaging the till and wasting its time and wasting the till machine resource (CPU)
2- you are polite, you move aside and wait so so that others can use the resource (till) until somebody in the queue finishes ( a good person) and give you a shout to tell you come in to the till to process your payment; you wake up and enter the pin number and go out from the super market.
Now when you sleep, the current thread locks the resource so no body can use it and wast the CPU time
while wait make the current thread release the lock on the object and does not ( this thread) actually wast the CPU time
There are much more explanantion, try to search this forum.
Regards,
Alan Mehio
London,UK

Similar Messages

  • Difference betn  wait() and sleep() method of a thread

    Can anyone briefly differentiate between the sleep() and wait() method of a thread.

    [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long)]sleep
    [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait()]wait

  • Difference between wait event and timed event

    Hi,
    Anyone has idea that what is the difference between wait events and timed events in Statspack report. I couldn't find it over google.
    Thanks.

    It's 10.2.0.1 on Linux
    (Couldn't do a query, because Linux is inside VM Ware. And it is not being accessed from Base windows machine.)
    Top 5 Timed Events                                                    Avg %Total
    ~~~~~~~~~~~~~~~~~~ wait Call
    Event Waits Time (s) (ms) Time
    db file scattered read 9,750,617 34,611 4 44.7
    CPU time 14,248 18.4
    read by other session 1,532,282 8,984 6 11.6
    db file sequential read 4,514,494 5,588 1 7.2
    latch: cache buffers lru chain 277,245 4,823 17 6.2
    Wait Events  DB/Inst: ABCD/ABCD  Snaps: 1-2
    -> s - second, cs - centisecond, ms - millisecond, us - microsecond
    -> %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
    -> Only events with Total Wait Time (s) >= .001 are shown
    -> ordered by Total Wait Time desc, Waits desc (idle events last)
    Avg
    %Time Total Wait wait Waits
    Event Waits -outs Time (s) (ms) /txn
    db file scattered read 9,750,617 0 34,611 4 24.2
    read by other session 1,532,282 0 8,984 6 3.8
    db file sequential read 4,514,494 0 5,588 1 11.2
    latch: cache buffers lru chain 277,245 0 4,823 17 0.7
    latch free 121,466 0 3,291 27 0.3
    ----------------------------------------------------------------------------------------------------

  • Difference between waiting for millsecond and wait for millisecond multiple

    pls help me out

    Here two nice links about your question:
    Differences Between "Wait (ms)" and "Wait Until Next ms Multiple"
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/12b2ea9ad5b265ad86256257004dd8e2?OpenDocument
    Software Timed Loops using Wait (ms) and Wait Until Next ms Multiple
    http://zone.ni.com/devzone/conceptd.nsf/webmain/E83351E12CD2D50886256B66006E4D15?opendocument
    Hope it help

  • What is the difference between PUSH and FETCH

    I am a little confused. I use my iphone for both my personal POP email accounts and my business exchange account. I am trying to save as much battery as I can so I turned off push and set everything to manual...but now when I try and get may mail....it either says "connecting" or "checking for new mail" at the bottom of the screen and nothing happens from there.
    What is the best way to setup this situation for the most battery life? I don't need it to automatically download emails just when I open the email accout would be nice.
    I also noticed that when I delete an email from my iphone on my exchange account, it also deletes is on my desktop at work...I need to turn this off...is it possible?

    Hi maxum25,
    The difference between push and fetch is that:
    When using push, the server sends a signal to the iphone and lets it know that an email is coming its direction. Kind of like receiving a call. The iphone does not need to do anything except receive the email.
    When using fetch, the iphone has to wake up every so often and send a request to the server to see if there is any new email waiting for it on the server to download. This takes more time because the iphone sends a request, the server says yes there is some, the iphone says ok give me the new email.
    Now the exchange email uses active sync to keep all changes on the exchange server and mobile device in sync. This is automatic and is the nature of exchange and active sync. In order to keep this from happening you would need to talk to your IT dept. and see if they have an imap or pop alternative. Even using imap reflects the changes back to the server.
    Hope this helps.

  • 1)Now I use Lightrom 5.7 how to upgrade to 6 or CC? 2) What is the difference between 6 and CC vercion? 3) When I used lightromm 3, I could see inEXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is ve

    1)Now I use Lightrom 5.7 how to upgrade to 6 or CC?
    2) What is the difference between 6 and CC version?
    3) When I used lightromm 3, I could see in EXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is very sad  I am stiil waiting and hope that it would be possibble in the new  versions. Or this indication may  possible by setting?

    1)Now I use Lightrom 5.7 how to upgrade to 6 or CC?
    Purchase the standalone upgrade from here: Products
    Download CC version from here: Explore Adobe desktop apps | Adobe Creative Cloud
    2) What is the difference between 6 and CC version?
    See this comparison chart: Compare Lightroom versions | Adobe Photoshop Lightroom CC
    3) When I used lightromm 3, I could see in EXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is very sad  I am stiil waiting and hope that it would be possibble in the new  versions. Or this indication may  possible by setting?
    Rob Cole's ExifMeta plugin displays the Subject Distance field (and much more).  Unfortunately, his Web site appears to be down again.  He used to be very active here, but he hasn't posted in several months.

  • Difference between version and release

    Hi all,
    can anybody tell me the difference between release and version of SAP. Where can i check whic version I am using and which release is it. whats the importance of release and version.
    When i goto utilities, and then version management i see SAP Rel 620, version 46C. CAn anyone pls give me some insight on this...Thanks a lot..waiting for reply...

    Hi,
    Version is specific to SAP System : For Eg: SAP R/3 4.6c, SAP ECC 6.0 etc...(Component Version)
    With in SAP System, You will have many Software Components: and each of them will have specific releases...
    For Eg: ECC 6.0 can have many softeare componets such as:
    IS-U : Utility compnent
    FICA : FI related compontns.
    SAP_APPL : ABAP compontns
    SAP_BASIS : BASIS components...
    Reward if useful
    Regards
    Shiva

  • MAIN DIFFERENCES BETWEEN PARALLEL AND SEQUENTAIL PRCESSING???

    HI PALS,
    I WANT THE COMPLETE DIFFERENCES BETWEEN PARALLEL AND SEQUENTIAL PROCESSING!
    IN THE CONTEXT OF RFC.

    Hi
    Parallel Processing
    To achieve a balanced distribution of the system load, you can use destination additions to execute function modules in parallel tasks in any application server or in a predefined application server group of an SAP system.
    Parallel-processing is implemented with a special variant of asynchonous RFC. Itu2019s important that you use only the correct variant for your own parallel processing applications: the CALL FUNCTION STARTING NEW TASK DESTINATION IN GROUP keyword. Using other variants of asynchronous RFC circumvents the built-in safeguards in the correct keyword, and can bring your system to its knees
    Details are discussed in the following subsections:
    ·        Prerequisites for Parallel Processing
    ·        Function Modules and ABAP Keywords for Parallel Processing
    ·        Managing Resources in Parallel Processing
    Prerequisites for Parallel Processing
    Before you implement parallel processing, make sure that your application and your SAP system meet these requirements:
    ·        Logically-independent units of work:
    The data processing task that is to be carried out in parallel must be logically independent of other instances of the task. That is, the task can be carried out without reference to other records from the same data set that are also being processed in parallel, and the task is not dependent upon the results of others of the parallel operations. For example, parallel processing is not suitable for data that must be sequentially processed or in which the processing of one data item is dependent upon the processing of another item of the data.
    By definition, there is no guarantee that data will be processed in a particular order in parallel processing or that a particular result will be available at a given point in processing. 
    ·        ABAP requirements:
    ¡        The function module that you call must be marked as externally callable. This attribute is specified in the Remote function call supported field in the function module definition (transaction SE37).
    ¡        The called function module may not include a function call to the destination u201CBACK.u201D
    ¡        The calling program should not change to a new internal session after making an asynchronous RFC call. That is, you should not use SUBMIT or CALL TRANSACTION in such a report after using CALL FUNCTION STARTING NEW TASK.  
    ¡        You cannot use the CALL FUNCTION STARTING NEW TASK DESTINATION IN GROUP keyword to start external programs. 
    ·        System resources: 
    In order to process tasks from parallel jobs, a server in your SAP system must have at least 3 dialog work processes. It must also meet the workload criteria of the parallel processing system: Dispatcher queue less than 10% full, at least one dialog work process free for processing tasks from the parallel job.
    Function Modules and ABAP Keywords for Parallel Processing
    You can implement parallel processing in your applications by using the following function modules and ABAP keywords:
    ·        SPBT_INITIALIZE: Optional function module. 
    Use to determine the availability of resources for parallel processing. 
    You can do the following:
    ¡        check that the parallel processing group that you have specified is correct.
    ¡        find out how many work processes are available so that you can more efficiently size the packets of data that are to be processed in your data.
    ·        CALL FUNCTION Remotefunction STARTING NEW TASK Taskname DESTINATION IN GROUP:
    With this ABAP statement, you are telling the SAP system to process function module calls in parallel. Typically, youu2019ll place this keyword in a loop in which you divide up the data that is to be processed into work packets. You can pass the data that is to be processed in the form of an internal table (EXPORT, TABLE arguments). The keyword implements parallel processing by dispatching asynchronous RFC calls to the servers that are available in the RFC server group specified for the processing.
    Note that your RFC calls with CALL FUNCTION are processed in work processes of type DIALOG. The DIALOG limit on processing of one dialog step (by default 300 seconds, system profile parameter rdisp/max_wprun_time) applies to these RFC calls. Keep this limit in mind when you divide up data for parallel processing calls. 
    ·        SPBT_GET_PP_DESTINATION: Optional function module. 
    Call immediately after the CALL FUNCTION keyword to get the name of the server on which the parallel processing task will be run. 
    ·        SPBT_DO_NOT_USE_SERVER: Optional function module. 
    Excludes a particular server from further use for processing parallel processing tasks. Use in conjunction with SPBT_GET_PP_DESTINATION if you determine that a particular server is not available for parallel processing (for example, COMMUNICATION FAILURE exception if a server becomes unavailable).
    ·        WAIT: ABAP keyword
    WAIT UNTIL
    Required if you wish to wait for all of the asynchronous parallel tasks created with CALL FUNCTION to return. This is normally a requirement for orderly background processing. May be used only if the CALL FUNCTION includes the PERFORMING ON RETURN addition.
    ·        RECEIVE: ABAP keyword
    RECEIVE RESULTS FROM FUNCTION Remotefunction
    Required if you wish to receive the results of the processing of an asynchronous RFC. RECEIVE retrieves IMPORT and TABLE parameters as well as messages and return codes.
    Managing Resources in Parallel Processing
    You use the following destination additions to perform parallel execution of function modules (asynchronous calls) in the SAP system:
    In a predefined group of application servers:
    CALL FUNCTION Remotefunction STARTING NEW TASK Taskname
    DESTINATION IN GROUP Groupname
    In all currently available and active application servers:
    CALL FUNCTION Remotefunction STARTING NEW TASK Taskname
    DESTINATION IN GROUP DEFAULT
    Sequential Processing
    In the following cases, the system chooses sequential (non-parallel) processing:
    ●      In table RSADMIN, entry QUERY_MAX_WP_DIAG has value (column value) 1.
    ●      The entire query consists of one sub-access only.
    ●      The query is running in a batch process.
    ●      The query was started from the query monitor (transaction RSRT) using various debug options (for example, SQL query display, execution plan display). See, Dividing a MultiProvider Query into Sub-Queries.
    ●      The query requests non-cumulative key figures.
    ●      Insufficient dialog processes are available when the query is executed. These are required for parallel processing.
    ●      The query is configured for non-parallel processing.
    ●      You want to save the result of the query in a file or a table.
    In Release SAP NetWeaver 7.0, the system can efficiently manage the large intermediate results produced by parallel processing. In previous releases, the system terminated when it reached a particular intermediate result size and proceeded to read data sequentially. This is no longer the case. Therefore, the RSADMIN parameter that was used in previous releases for reading a MultiProvider sequentially is no longer used.
    Reward If Helpfull,
    Naresh

  • Difference between SPAM and SAINT

    hi all,
          Can anybody tell me that what is the difference between SPAM and SAINT transactions
    and can anybody explain me the senarios in which they are used with examples and step by step guidance
    waiting for your reply..........
    regards,
    Hardik.

    SPAM (Support Package application manager)- It is used for applying support packages
    (eg. Basis, ABAP or application patches)
    SAINT (SAP Add-on installation tool) - It is used to install add-on's (eg. SEM or FINBASIS add-on for BI)

  • Difference between Workflow and Alert management

    HI all
    Let me know the difference between workflow and alert management. ?
    In Workflow if we  want to trigger alert or mail.
    We can use SO_NEW_DOCUMENT_SEND_API1 FM send mail.
    But in alert we can use different method?
    Can i know wht the exact difference between two?

    Hi,
    email messages can be sent with both technologies...
    If you need to send just a simple email, use the ALM.
    If you need to send email and wait something adding additional flows....use the Worflow.
    Remember that with ALM is not possible to attach something to the email.
    You can add additional steps like web addresses in order to perform further activities.
    Luciano

  • Difference between Scheduled and released with respect to process chains

    HI All,
    I am Creating a cube in whcih I want to upload the current status of the process chain.
    And the requirement is not to take those process chains whcih are scheduled and not released( only take those process chains whcih have status released)
    for the same I dont know what is the difference between Scheduled and Released in respect of process Chains and also from whcih Database table I can get this information.
    Please help.
    Regards,
    Ujjwal

    Hi,
    Job Status Scheduled means a job has been created and is ready to run but has not yet been triggered.
    A release status means the created job has been triggered and is waiting for the opportunity to run. A job can be in released status when it is a periodic Job ( Where once the job is completed it goes to release status), when it is slated for future execution, or when there is a delay due to database overload.
    Regards,
    Pramod

  • Whats the difference between SM50 and sm38

    HI GURUS
    whats the difference between SM50 and sm38??? job overview and process overview

    hi sharma,
    sm38: intial queueueue Info, information about the request quest queue of the server in question is displayed. The dispatcher forwards each request it receives to a work process of the appropriate type. If all the processes of this type are occupied, the dispatcher stores the request in a queue.
    In the queue info you can see for each work process type:
    ·        The number of requests currently waiting. Usually this should be 0.
    ·        The total number of requests waiting, since the server has been running.
    ·        The maximum number of requests that can be stored in the queue (specified in profile parameter rdisp/elem_per_queue)
    ·        The number of requests written and read since the server has been running.
    sm50: work process dialog steps in user transactions, updates, lock administration, etc.
    this transcatin Choosing Administration
    System Administration  Monitor  System Monitoring
    Process Overview or transaction
    For example, you can monitor processes to determine if the number of work processes in your system is adequate, to assess if the instance is working to full capacity, to gather information for trouble-shooting, or for tuning.
    DIA work process for executing dialog steps in user transactions.
    DIA work process for executing dialog steps in user transactions
    UPD: Update process for making U1 (time-critical) database changes
    UP2: Update process for executing U2 (not time-critical)
    database changes
    ENQ for setting and releasing locks on SAP lock objects
    BTC for executing background jobs
    SPO for spool formatting processes
    regards
    vijju

  • Difference between RSRD_BROADCAST_STARTER and RSRD_BROADCAST_BATCH

    Hi All,
    Currently we use RSRD_BROADCAST_STARTER program to trigger daily mail broadcasting but will happen an error: Parallel processing not possible: no processing of xx package(s). in order to resolve this issue we search a link where it is mentioned to use the other program for RSRD_BROADCAST_BATCH and use delay steps. http://wiki.sdn.sap.com/wiki/display/BI/Common+Error+Messages+from+the+Broadcast+Log. We have no idea about the difference between RSRD_BROADCAST_STARTER and RSRD_BROADCAST_BATCH, could any experts explain about this. This is a urgent case for us, thanks in advance!

    Your error has been explained below in one of the WIKI.
    ERROR: 'Parallel processing not possible: no processing of X package(s)'
    To overcome Parallel Processing errors create a Process Chain which executes settings using report RSRD_BROADCAST_BATCH.
    Create the variants for report RSRD_BROADCAST_BATCH. Start transaction SE38 and execute the report. Select the setting(s) and save them as a variant.
    Include a process step in a process chain which executes an ABAP program. In the process step, choose the report RSRD_BROADCAST_BATCH and the variant (from step 1) in the process chain step.
    Simulate a sequential execution by adding an additional wait-step in between process steps calling report RSRD_BROADCAST_BATCH, e.g. by adding a process chain step which calls a simple Z-report that waits for a given timeframe using the ABAP statement WAIT UP TO XX SECONDS.

  • Difference between streaming and chunking

    Hi,
    I am working in a secure proxy project. Already we implemented chunking funcionality. Chunking meas when client accessing a big file- no need to wait until the total page downloaded(we generally observe status bar to say request is in processing). Depending on the specified chunked size, output will display onto client browser in chunks...
    Now the requirement is to implement streming....
    But we r not sure..what is the exact difference between Streaming and chunking.....Will any one give some inputs or ideas....
    Thanks,

    Double posted and answered
    http://forum.java.sun.com/thread.jspa?threadID=736983

  • N97 bad music player, difference between v20 and v...

    Hi,
    Can anyone tell me the changes of the music player made in firmware version 21.0.045 compared to version 20.0.019?
    All the changes logs I can find say “music player improvements” but I can't find any.
    The difference between v20 and the version before that ware obvious.
    “Improvements” like the “back” button going back to the home screen instead of the music list you ware coming from.
    The removal of the search function in portrait mode, you can only search songs with the hardware keyboard, so no portrait touchscreen keyboard search. (very annoying when using a car dashboard stand).
    And they ruined the search function all together. Now I can only search on the first word of a song, album or artiste. First I was able to search just a (part of a)word and all songs containing that word in the title would be found. I have almost 1500 songs on my N97 with only 1/3 of 32GB used. How can the expect me to remember all first words of about 4500 songs!
    And all the album art in the lists, which makes for less songs on the screen at once. I don't like that very much, but that's just me I guess.
    So overall the made an oké music player into an annoying player ware bey I have to remember way to much to use it properly
    Of course I hoped that v21 would bring some positive chances to the music player, but I cant find any. Can Anyone tell me the changes, if any. Or are they all under the hood? But I haven't noticed any performance boosts either.
    Hope to hear from someone.

    I do not think that N97's music player  is going to be fixed in any way...
    Why? Because N97 is the worst device Nokia has ever produced! They will stop N97 software upgrading   because  many things in this phone went wrong. Now they claim they can fix it. And I claim: no, they can not. If they could save the sinking ship of N97 we would wait for so long for the solution of the problem called N97.
    Look how irresponsible N97 becomes when you start music player!
    Is this CPU issue? Playing mp3 file with 400 MHz cpu is very big deal!
    My E71 has never stopped responding, and what I dit with E71 was multitasking torture!

Maybe you are looking for

  • Problem with light room cc install

    after downloading LR CC via my cloud account all I get is a quick splash screen and then nothing.  Tried uninstall and reinstall and reboot computer  -- neither helped.  Running OS  X 10.10.3

  • In MS SQL SEVER.dateadd(month,1,dateordatetypevariable)What in ORACLE

    EXPERTS! In MS SQL Server to add a month in a date or date type variable there is dateadd(month,1,'27-Oct-2001') function which return 27-Nov-2001 & we can directly assign it as, select @variable = dateadd(month,1,'27-Oct-2001'). WHAT IS THE EQUAL IN

  • Select columns order by

    Hi, my table is exg(phone_no,com_date) Records are like 1111 01-oct-2004 2222 01-oct-2004 3333 02-oct-2004 1111 05-oct-2004 1111 08-oct-2004 3333 09-oct-2004 Is there any select qeuery to get the report like 1111 01-oct-2004 1111 05-oct-2004 1111 08-

  • RSRV Correct Error in Proocess chain

    Hi collegues, I'm facing a Maintenance issue. We have cubes where dimensions degenerate because of data deletion. Then we have a rrather high number of records in Dimensions that are not in the Fact Table of an InfoCube. With RSRV we can correct this

  • Tables for Release Procedure

    Hi All what are the Tables used for Contracts & Scheduling Agreements. Regards JK