Search Results

Search found 1122 results on 45 pages for 'concurrent'.

Page 7/45 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Preventing concurrent data modification in Web based app

    - by Manoj
    Hi, I am building a web app in Silverlight which allows users to view and edit a database. In order to prevent multiple users from editing the same data, I was thinking of implementing a lock and key mechanism, so that other users are made to wait when one particular user is editing the data. Is there any way in which we can have variable(flag specifying if a user is editing data) in the server which can be shared across multiple clients? Is there a better way to manage this type of conurrent data access issues?

    Read the article

  • Oracle (PL/SQL): Is UPDATE RETURNING concurrent?

    - by Jaap
    I'm using table with a counter to ensure unique id's on a child element. I know it is usually better to use a sequence, but I can't use it because I have a lot of counters (a customer can create a couple of buckets and each of them needs to have their own counter, they have to start with 1 (it's a requirement, my customer needs "human readable" keys). I'm creating records (let's call them items) that have a prikey (bucket_id, num = counter). I need to guarantee that the bucket_id / num combination is unique (so using a sequence as prikey won't fix my problem). The creation of rows doesn't happen in pl/sql, so I need to claim the number (btw: it's not against the requirements to have gaps). My solution was: UPDATE bucket SET counter = counter + 1 WHERE id = param_id RETURNING counter INTO num_forprikey; PL/SQL returns var_num_forprikey so the item record can be created. Question: Will I always get unique num_forprikey even if the user concurrently asks for new items in a bucket?

    Read the article

  • Inconsistency in java.util.concurrent.Future?

    - by loganj
    For the sake of argument, let's say I'm implementing Future for a task which is not cancelable. The Java 6 API doc says: After [cancel()] returns, subsequent calls to isDone() will always return true. [cancel()] returns false if the task could not be cancelled, typically because it has already completed normally It also says: [isDone()] returns true if this task completed. But what if my cancellation fails not because the task is already completed, but because it simply cannot be cancelled? Is there a way out of this contradiction (other than making my uncancelable task cancelable and sidestepping it altogether)?

    Read the article

  • High concurrent request server in ruby

    - by WedTM
    I'm trying to write a simple server that will grab an mp3 file from rackspace cloudfiles, and stream it to a client over HTTP. The server must be able to stream to multiple clients simultaneously, however, I'm finding it difficult to come up with a viable solution. Anyone have some ideas?

    Read the article

  • Is there a concurrent container library for C++

    - by Lirik
    I'm looking for implementations of lock-free containers: Blocking Queue Blocking Stack Hash Map etc... Are there any good libraries out there? I would like to refrain from writing these data structures... I would much rather use something that has been tested by the community.

    Read the article

  • Java Download Concurrent Data

    - by xger86x
    Hi, i'm developing an app which download map tiles around different places in a city. To do this, i have one thread for each place in which i select the tiles and create a thread to download each. Well, the question is how to avoid creating a thread for a tile that already exists in the thread pool. Should not just check if the file exists, since it is possible that the thread for that tile already exists (other place already need that tile) but the file has not been created- Any idea? Thanks

    Read the article

  • Java: Making concurrent MySQL queries from multiple clients synchronised

    - by Misha Gale
    I work at a gaming cybercafe, and we've got a system here (smartlaunch) which keeps track of game licenses. I've written a program which interfaces with this system (actually, with it's backend MySQL database). The program is meant to be run on a client PC and (1) query the database to select an unused license from the pool available, then (2) mark this license as in use by the client PC. The problem is, I've got a concurrency bug. The program is meant to be launched simultaneously on multiple machines, and when this happens, some machines often try and acquire the same license. I think that this is because steps (1) and (2) are not synchronised, i.e. one program determines that license #5 is available and selects it, but before it can mark #5 as in use another copy of the program on another PC tries to grab that same license. I've tried to solve this problem by using transactions and table locking, but it doesn't seem to make any difference - Am I doing this right? Here follows the code in question: public LicenseKey Acquire() throws SmartLaunchException, SQLException { Connection conn = SmartLaunchDB.getConnection(); int PCID = SmartLaunchDB.getCurrentPCID(); conn.createStatement().execute("LOCK TABLE `licensekeys` WRITE"); String sql = "SELECT * FROM `licensekeys` WHERE `InUseByPC` = 0 AND LicenseSetupID = ? ORDER BY `ID` DESC LIMIT 1"; PreparedStatement statement = conn.prepareStatement(sql); statement.setInt(1, this.id); ResultSet results = statement.executeQuery(); if (results.next()) { int licenseID = results.getInt("ID"); sql = "UPDATE `licensekeys` SET `InUseByPC` = ? WHERE `ID` = ?"; statement = conn.prepareStatement(sql); statement.setInt(1, PCID); statement.setInt(2, licenseID); statement.executeUpdate(); statement.close(); conn.commit(); conn.createStatement().execute("UNLOCK TABLES"); return new LicenseKey(results.getInt("ID"), this, results.getString("LicenseKey"), results.getInt("LicenseKeyType")); } else { throw new SmartLaunchException("All licenses of type " + this.name + "are in use"); } }

    Read the article

  • NoSQL for concurrent reads/writes

    - by Mickael Marrache
    After getting some performance issues for an application using a MySQL database, I'm thinking of using NoSQL solutions. My architecture is as follows: One application receives messages from the network at a high throughput (i.e. 50000 messages/sec). Each message is stored in the DB, so it's important for the write rate to be as fast as the arrival rate. Then, I also have some PHP pages that accesses the DB to get the data stored by the other application. It's important for me that the retrieved data is as relevant as possible (i.e. not old data, let's say not more than 5 seconds old). Also, the data is not critical, so I don't need any security mechanism to avoid losing the data. I see there are a lot of NoSQL solutions, but I don't know if they are all relevant. Could you please provide me some directions. Thanks

    Read the article

  • My Rails session is getting reset when I have concurrent requests

    - by alex_c
    I think I might be misunderstanding something about Rails sessions, so please bear with me, I might not be phrasing my question the best way. I'm working on an iPhone app with a Ruby on Rails backend. I have a web view which by default goes to the index action of one controller (and uses sessions), and in the background a bunch of API calls going to a different controller (and which don't need to use sessions). The problem is, the sessions set by my web view seem to be overwitten by the API calls. My staging server is pretty slow, so there's lots of time for the requests to overlap each other - what I see in the logs is basically this: Request A (first controller) starts. Session is empty. Request B (second controller) starts. Session is empty. Request A finishes. Request A has done authentication, and stored the user ID in the session. Session contains user ID. Request B finishes. Session is empty. Request C starts. Session is empty - not what I want. Now, the strange thing is that request B should NOT be writing anything to the session. I do have before and after filters which READ from the session - things like: user = User.find_by_id(session[:id]) or logger.debug session.inspect and if I remove all of those, then everything works as expected - session contents get set by request A, and they're still there when request C starts. So. I think I'm missing something about how sessions work. Why would reading from the session overwrite it? Should I be accessing it some other way? Am I completely on the wrong track and the problem is elsewhere? Thank you for any insights!

    Read the article

  • Concurrent usage of table causing issues

    - by Sven
    Hello In our current project we are interfacing with a third party data provider. They need to insert data in a table of ours. This inserting can be frequent every 1 min, every 5min, every 30, depends on the amount of new data they need to provide. The use the isolation level read committed. On our end we have an application, windows service, that calls a webservice every 2 minutes to see if there is new data in this table. Our isolation level is repeatable read. We retrieve the records and update a column on these rows. Now the problem is that sometimes this third party provider needs to insert a lot of data, let's say 5000 records. They do this per transaction (5rows per transaction), but they don't close the connection. They do one transaction and then the next untill all records are inserted. This caused issues for our process, we receive a timeout. If this goes on for a long time the database get's completely unstable. For instance, they maybe stopped, but the table somehow still stays unavailable. When I try to do a select on the table, I get several records but at a certain moment I don't get any response anymore. It just says retrieving data but nothing comes anymore until I get a timeout exception. Only solution is to restart the database and then I see the other records. How can we solve this. What is the ideal isolation level setting in this scenario?

    Read the article

  • Concurrent connections in C# socket

    - by Chu Mai
    There are three apps run at the same time, 2 clients and 1 server. The whole system should function as following: The client sends an serialized object to server then server receives that object as a stream, finally the another client get that stream from server and deserialize it. This is the sender: TcpClient tcpClient = new TcpClient(); tcpClient.Connect("127.0.0.1", 8888); Stream stream = tcpClient.GetStream(); BinaryFormatter binaryFormatter = new BinaryFormatter(); binaryFormatter.Serialize(stream, event); // Event is the sending object tcpClient.Close(); Server code: TcpListener listener = new TcpListener(IPAddress.Parse("127.0.0.1"), 8888); listener.Start(); Console.WriteLine("Server is running at localhost port 8888 "); while (true) { Socket socket = listener.AcceptSocket(); try { Stream stream = new NetworkStream(socket); // Typically there should be something to write the stream // But I don't knwo exactly what should the stream write } catch (Exception e) { Console.WriteLine("Exception: " + e.Message); Console.WriteLine("Disconnected: {0}", socket.RemoteEndPoint); } } The receiver: TcpClient client = new TcpClient(); // Connect the client to the localhost with port 8888 client.Connect("127.0.0.1", 8888); Stream stream = client.GetStream(); Console.WriteLine(stream); when I run only the sender and server, and check the server, server receives correctly the data. The problem is when I run the receiver, everything is just disconnected. So where is my problem ? Could anyone point me out ? Thanks

    Read the article

  • concurrent doubly-linked list (1 writer, n-readers)

    - by Arne
    Hi guys, I am back in the field of programming for my Diploma-thesis now and stumbled over the following issue: I need to implement a thread-safe doubly-linked list for one thread writing the list at any position (delete, insert, mutate node data) and one to many threads traversing and reading the list. I am well aware that mutexes can be used to serialize access to the list, still I presume that a naive lock around any write operation will be less than optimal. I am wondering whether there are better variants. (I am well aware that 'optimal' has not much of a practical meaning as long as no exact measure/profiling are available but this is an academic thesis after all..) I am very gratefull for code-samples as well as references to academic granted these have at least a tiny bit of practical relevance. Thanks at lot

    Read the article

  • Live Updating Widget for 100+ concurrent users

    - by flavio87
    Hi there what would you use if you had to have a div box on your website that would have to be updated constantly with new HTML content from the server. simple polling is probably not very resource inefficient - imagine also having 10'000 users and the div has to update. what is the most efficient or elegant solution for such a problem? are there existing widgets which contain this "autoupdate" functionality?

    Read the article

  • examples of good concurrent programs meant to scale

    - by vishr
    I am looking for seminal and excellent examples of libraries and projects that emulate the good practices of the Java Concurrency in Practice book. The book is marvelous. However, I think supplementing this book reading with code reviews of projects and libraries that make use of the concurrency APIs effectively is necessary to drive the concepts into the brain. One good example of what I am looking for is https://code.google.com/p/concurrentlinkedhashmap/ Can folks help me with finding exemplary, well written code that use the concurrency api well?

    Read the article

  • Improving the efficiency of multiple concurrent Core Animation animations

    - by Alex
    I have a view in my app that is very similar to the month view in the built-in Calendar app. There's a subview that holds the individual cells (a custom UIView subclass that draws text into its layer), and when the user navigates to the next "month", I create the new cells and slide the view to show them. When the animation stops, I remove the old, hidden cells and set things up so it's ready to go for the next animation. This all works nicely. However, I'd like to animate the cells' text color, as in the Calendar app, so that the outgoing ones transition to a lighter color and the incoming ones transition to a darker color. The problems is that I can have as many as 70 cells, so doing individual animations is very slow -- between 5-10 fps on my iPhone 3GS. I'm trying to find a less computationally intense way of doing this. My reading of the Shark results is that the majority of the time is spent redrawing the text for each frame for each frame. This makes sense, since text rendering is hardly the cheapest operation. I've considered creating a second view -- one holding the "outgoing" state and one holding the "incoming" state and using a single opacity animation to gradually reveal the updated cells while both are sliding. I'm concerned that instead of having 70 cells, I'll have 140, which seems like a lot of views. So, is that too many views or would there be a better way of doing this?

    Read the article

  • Multiple Concurrent Changes Using SVN, GIT, and CVS

    - by KlaxSmashing
    At work, we are using SVN, CVS, and GIT because there any many projects that were started at various times. Anyway, a common sequence that occurs is as follows: Working on task A, making changes to project Has new task B, some bug or functionality needs to be done on project, independent of task A but may affect same set of files Check in task B Check in task A Unfortunately, what I do at this time is two maintain 2 working copies of each project. So I can always work on task B from a clean copy. As you can imagine, this is wasteful and also, does not scale well (task C, D, E, etc.) For each of these versioning systems, are there commands that can help me do the following: "Save" task A, reverting working copy to current repository Work on task B, check in changes "Restore" task A changes back to working copy

    Read the article

  • Concurrent processes do not utilize all available CPU

    - by metdos
    I run some processes on an EC2 cc2.8xlarge instance which has 32 virtual processors. For some type of processes, when I run 16 processes on parallel, all of them use 100% of CPU cycles. But for other type of processes, they are not using 100% CPU and they finish considerably slower than a single thread. There is no time spend on IO and all data is served from memory. Do you have any idea about the reason of this problem?

    Read the article

  • Why does java.util.concurrent.ArrayBlockingQueue use 'while' loops instead of 'if' around calls to

    - by theFunkyEngineer
    I have been playing with my own version of this, using 'if', and all seems to be working fine. Of course this will break down horribly if signalAll() is used instead of signal(), but if only one thread at a time is notified, how can this go wrong? Their code here - check out the put() and take() methods; a simpler and more-to-the-point implementation can be seen at the top of the JavaDoc for Condition. Relevant portion of my implementation below. public Object get() { lock.lock(); try { if( items.size() < 1 ) hasItems.await(); Object poppedValue = items.getLast(); items.removeLast(); hasSpace.signal(); return poppedValue; } catch (InterruptedException e) { e.printStackTrace(); return null; } finally { lock.unlock(); } } public void put(Object item) { lock.lock(); try { if( items.size() >= capacity ) hasSpace.await(); items.addFirst(item); hasItems.signal(); return; } catch (InterruptedException e) { e.printStackTrace(); } finally { lock.unlock(); } } P.S. I know that generally, particularly in lib classes like this, one should let the exceptions percolate up.

    Read the article

  • Parallel programming patterns for C#?

    - by VoidDweller
    With Intel's launch of a Hexa-Core processor for the desktop, it looks like we can no longer wait for Microsoft to make many-core programming "easy". I just order a copy of Joe Duffy's book Concurrent Programming on Windows. This looks like a great place to start, though, I am hoping some of you who have been targeting multi/many core systems would point me to some good resources that have or would have helped on your projects?

    Read the article

  • How to learn about Threads, Especially in Java.

    - by Javed Ahamed
    I have always been kind of confused by threads, and my class right now makes heavy use of them. We are using java.util.concurrent but I don't even really get the basics. UpDownLatch, Futures, Executors; these words just fly over my head. Can you guys suggest any resources to help learn what I need from the ground up? Thanks a lot in advance!

    Read the article

  • Is FreeBSD more suitable than CentOS for firing 40k concurrent connections (for Jmeter)?

    - by blacklotus
    Hi, I am trying to run Jmeter to simulate 40k concurrent users and stress test a particular system. Putting aside the possibility that Jmeter may not be able to push such a high number (although I have read that it is at least possible to handle 10k concurrent threads on a very powerful machine), is FreeBSD a more suitable OS as compare to CentOS to be used for my Jmeter machine for handling 40k (or as high as possible) of concurrent outbound connections? Reason for asking this is that, I have found articles on FreeBSD for tuning and optimizing for maximum outbound connections, but seem to have little luck with CentOS. It makes me wonder if for some specific reasons, people don't use CentOS for such high number of outbound connections. Personally however, I am more familiar with CentOS and would like to stick with it if possible. Any input is greatly appreciated!

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >