DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    J Alder Guest

    Which methods should be thread safe?


    I am creating a data file with methods

    insertRecord

    updateRecord

    deleteRecord

    findRecords

    getSize

    Which methods need to be syncronized? Any input would be appreciated..

  2. #2
    Ako Guest

    Re: Which methods should be thread safe?


    It depends on the degree of concurrency and lock granularity that you want
    to implement. Any method that updates a resource in a way that may cause
    a conflict it should be synchronized.


    updateRecord and deleteRecord will have to be synchronized in all cases.

    Good Luck,

    Ako



    "J Alder" <jAdler@feverton.gov> wrote:
    >
    >I am creating a data file with methods
    >
    >insertRecord
    >
    >updateRecord
    >
    >deleteRecord
    >
    >findRecords
    >
    >getSize
    >
    >Which methods need to be syncronized? Any input would be appreciated..



  3. #3
    J Alder Guest

    Re: Which methods should be thread safe?


    Thanks for the response AKO.. I'll do it!
    "Ako" <ays73@hotmail.com> wrote:
    >
    >It depends on the degree of concurrency and lock granularity that you want
    >to implement. Any method that updates a resource in a way that may cause
    >a conflict it should be synchronized.
    >
    >
    >updateRecord and deleteRecord will have to be synchronized in all cases.
    >
    >Good Luck,
    >
    >Ako
    >
    >
    >
    >"J Alder" <jAdler@feverton.gov> wrote:
    >>
    >>I am creating a data file with methods
    >>
    >>insertRecord
    >>
    >>updateRecord
    >>
    >>deleteRecord
    >>
    >>findRecords
    >>
    >>getSize
    >>
    >>Which methods need to be syncronized? Any input would be appreciated..

    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links