Search Results

Search found 341 results on 14 pages for 'atomic'.

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

  • Core Data store corruption

    - by sehugg
    A handful of customers for my iPhone app are experiencing Core Data store corruption (I assume so, since the error is "Failed to save to data store: Operation could not be completed. (Cocoa error 259.)") Has anyone else experienced this kind of store corruption? I am worried since I aim to soon push an update which performs a schema migration, and I am worried that this will expose even more problems. I had assumed that the Core Data/SQLlite APIs use atomic operations and are immune to corruption except if the underlying filesystem experiences corruption. Is there a way to reduce/prevent corruption, or at least a good way to reproduce (I have been unsuccessful thus far).

    Read the article

  • How is thread synchronization implemented, at the assembly language level?

    - by Martin
    While I'm familiar with concurrent programming concepts such as mutexes and semaphores, I have never understood how they are implemented at the assembly language level. I imagine there being a set of memory "flags" saying: lock A is held by thread 1 lock B is held by thread 3 lock C is not held by any thread etc But how is access to these flags synchronized between threads? Something like this naive example would only create a race condition: mov edx, [myThreadId] wait: cmp [lock], 0 jne wait mov [lock], edx ; I wanted an exclusive lock but the above ; three instructions are not an atomic operation :(

    Read the article

  • How to improve my LDAP schema?

    - by asmaier
    Hello, I have a OpenLDAP Database and it holds some project objects that look like dn: cn=Proj1,ou=Project,ou=ua,dc=org cn: Proj1 objectClass: top objectClass: posixGroup member: 001ag member: 002ag System: ABEL System: PCx Budget: ABEL:1000000:0.3 Budget: PCx:300000:0.3 One can see that the Budget attribute is a ":"-separated string, where the first part holds the name of the system the budget is for, the second part holds some budget (which may change every month) and the last entry is a conversion factor for the budget of that system. Seeing this, I thought this is bad database design, since attribute values should always be atomic. But how can I improve that in LDAP, so that I can do a direct ldapsearch or a direct ldapmodify of the budget of System "ABEL" instead of writing a script, that will have to parse and split the ":"-separated string?

    Read the article

  • R: ggplot2, how to add a number of layers to a plot at once to reduce code

    - by John
    library(ggplot2) This code produces a nice looking plot: qplot(cty, hwy, data = mpg, colour = displ) + scale_y_log2() + labs(x="x axis") + labs(y="y axis") + opts(title = "my title") But I want to setup variables to try and to reduce code repetition: log_scale <- scale_y_log2() xscale <- labs(x="x axis") yscale <- labs(y="y axis") title <- opts(title = "my title") my_scales <- c(log_scale, xscale, yscale, title) # make a variable to hold the scale info changes above So that I can do this and add a bunch of things at the same time: qplot(cty, hwy, data = mpg, colour = displ) + my_scales # add these to your plot. but I get this error: Error in object$class : $ operator is invalid for atomic vectors I realize that the things going into my_scales need to be layers / different types of objects, but I don't see what they should be.

    Read the article

  • Multithreading and booleans

    - by Ikaso
    Hi Everyone, I have a class that contains a boolean field like this one: public class MyClass { private boolean boolVal; public boolean BoolVal { get { return boolVal; } set { boolVal = value; } } } The field can be read and written from many threads using the property. My question is if I should fence the getter and setter with a lock statement? Or should I simply use the volatile keyword and save the locking? Or should I totally ignore multithreading since getting and setting boolean values atomic? regards,

    Read the article

  • nested page-faulting of user-space address in Linux

    - by shankar
    Hi, I would like to know if it is functionally wrong to page-fault a user-space address when kernel is running fault-handler to bring in a user-page. OS is Linux 2.6.30 Assume that both user-addresses are valid ( falling within vma , rw permission ) for the task. When I check the kernel code, i find that the kernel does not mind the nested fault if the faulted-addresses are valid and the fault did not occur in atomic-context or in irq handler. (I dont think the answer is cpu-specific, but I would add that i am interested in arm and mips ). eg : The scenario can happen if I print stack-data from page-fault handler. thanks shankar

    Read the article

  • In MS SQL Server, is there a way to "atomically" increment a column being used as a counter?

    - by Dan P
    Assuming a Read Committed Snapshot transaction isolation setting, is the following statement "atomic" in the sense that you won't ever "lose" a concurrent increment? update mytable set counter = counter + 1 I would assume that in the general case, where this update statement is part of a larger transaction, that it wouldn't be. For example, I think this scenario is possible: update the counter within transaction #1 do some other stuff in transaction #1 update the counter with transaction #2 commit transaction #2 commit transaction #1 In this situation, wouldn't the counter end up only being incremented by 1? Does it make a difference if that is the only statement in a transaction? How does a site like stackoverflow handle this for its question view counter? Or is the possibility of "losing" some increments just considered acceptable?

    Read the article

  • Is it possible to create thread-safe collections without locks?

    - by Andrey
    This is pure just for interest question, any sort of questions are welcome. So is it possible to create thread-safe collections without any locks? By locks I mean any thread synchronization mechanisms, including Mutex, Semaphore, and even Interlocked, all of them. Is it possible at user level, without calling system functions? Ok, may be implementation is not effective, i am interested in theoretical possibility. If not what is the minimum means to do it? EDIT: Why immutable collections don't work. This of class Stack with methods Add that returns another Stack. Now here is program: Stack stack = new ...; ThreadedMethod() { loop { //Do the loop stack = stack.Add(element); } } this expression stack = stack.Add(element) is not atomic, and you can overwrite new stack from other thread. Thanks, Andrey

    Read the article

  • Synchronisation construct inside pragma for

    - by Sayan Ghosh
    Hi, I have a program block like: for (iIndex1=0; iIndex1 < iSize; iIndex1++) { for (iIndex2=iIndex1+1; iIndex2 < iSize; iIndex2++) { iCount++; fDist =(*this)[iIndex1].distance( (*this)[iIndex2] ); m_oPDF.addPairDistance( fDist ); if ((bShowProgress) && (iCount % 1000000 == 0)) xyz_exception::ui()->progress( iCount, (size()-1)*((size()-1))/2 ); } } } } I have tried parallelising the inner and outer loop and by putting iCount in a critical region. What would be the best approach to parallelise this? If I wrap iCount with omp single or omp atomic then the code gives an error and I figured out that would be invalid inside omp for. I guess I am adding many extraneous stuffs to paralellise this. Need some advice... Thanks, Sayan

    Read the article

  • Where are the really high quality and complex Swing components?

    - by jouhni
    Looking at Swing, I have the feeling that it comes with many useful and reasonable atomic components in its core. And when I look at the Web there are hundrets of quickly plugged together components (among them many date/time pickers, pimped lists and tables), which have in common that I could easily write them on my own, if I needed them. When I build big software and come to the point where I need a domain-specific component which is really big, I mostly come to the point where I have to write it on my own, which, due to the point that they are not just plugged together lists and tables, isn't done qickly. So, the question is, why are there no Swing component galleries which contain more than just customized date/time pickers or lists with added tree support. Where are the components which really raise the level of abstraction, or are in best case domain-specific?

    Read the article

  • Atoms and references

    - by StackedCrooked
    According to the book Programming Clojure refs manage coordinated, synchronous changes to shared state and atoms manage uncoordinated, synchronous changes to shared state. If I understood correctly "coordinated" implies multiple changes are encapsulated as one atomic operation. If that is the case then it seems to me that coordination only requires using a dosync call. For example what is the difference between: (def i (atom 0)) (def j (atom 0)) (dosync (swap! i inc) (swap! j dec)) and: (def i (ref 0)) (def j (ref 0)) (dosync (alter i inc) (alter j dec))

    Read the article

  • MSDTC Distributed Transaction Coordinator Enabling

    - by Curtis White
    I've a web server and a separate SQL server. I'm trying to use transaction scope to ensure that SQL queries are completed with my linq queries. I wrap everything with this using (TransactionScope scope = new TransactionScope()) I want to know where I need to install DTC. Do I need to install it on the IIS 7.5 box AND the SQL server? Do I need to unblock some ports? Are there any security risk in doing so? I've setup this up once before but don't remember how. If I can't get access to DTC then is there any other way to ensure a lINQ and sql query is atomic?

    Read the article

  • what is value of x for load and store

    - by Kevinniceguy
    This is some challenge On a single processor system, in which load and store are assumed to be atomic, what are all the possible values for x after both threads have completed in the following execution, assuming that x is initialised to O? Hint: you need to consider how this code might be compiled into machine language. for (int i = 0; i < 5; i++) : x = x + 1; for (int j = 0; j < 5; j++) : x = x + 1;

    Read the article

  • Stopping looping thread in Java

    - by halfwarp
    I'm using a thread that is continuously reading from a queue. Something like: public void run() { Object obj; while(true) { synchronized(objectsQueue) { if(objectesQueue.isEmpty()) { try { objectesQueue.wait(); } catch (InterruptedException e) { e.printStackTrace(); } obj = objectesQueue.poll(); } } // Do something with the Object obj } } What is the best way to stop this thread? I see two options: 1 - Since Thread.stop() is deprecated, I can implement a stopThisThread() method that uses a n atomic check-condition variable. 2 - Send a Death Event object or something like that to the queue. When the thread fetches a death event it exists. I prefer the 1st way, however, I don't know when to call the stopThisThread() method, as something might be on it's way to the queue and the stop signal can arrive first (not desirable). Any suggestions?

    Read the article

  • Arguments to convince to switch from CVS to SVN

    - by ereOn
    Hi, The UNIX department of my company currently uses CVS as source-version control system. They use it in a very strange way: different repositories for development/testing/production code (for the same project), no one tags anything, weird directory architecture, and so on. The system has been set for ages but now, I have an opportunity to organize a meeting where I have to suggest changes. I'd like to make them change from CVS to SVN (Mercurial or Git might be even better, however I can't really recommand using a system I don't know well, and switching to SVN will already be a great step forward). I don't have much experience with CVS so I can't compare them efficiently: I just know it doesn't support atomic operations and that it is deprecated. What killer arguments would you use to convince my collegues to do the switch ? Thank you very much.

    Read the article

  • perl script grabbing environment vars from "someplace else"

    - by Michael Wilson
    On a Solaris box in a "mysterious production system" I'm running a perl script that references an environment variable. No big deal. The contents of that variable from the shell both pre and post execution are what I expect. However, when reported by the script, it appears as though it's running in some other sub-shell which is clobbering my vars with different values for the duration of the script. Unfortunately I really can't paste the code. I'm trying to get an atomic case, but I'm at my wit's end here. Thoughts?

    Read the article

  • What's a unit test? [closed]

    - by Tyler
    Possible Duplicates: What is unit testing and how do you do it? What is unit testing? I recognize that to 95% of you, this is a very WTF question. So. What's a unit test? I understand that essentially you're attempting to isolate atomic functionality but how do you test for that? When is it necessary? When is it ridiculous? Can you give an example? (Preferably in C? I mostly hear about it from Java devs on this site so maybe this is specific to Object Oriented languages? I really don't know.) I know many programmers swear by unit testing religiously. What's it all about? EDIT: Also, what's the ratio of time you typically spend writing unit tests to time spent writing new code?

    Read the article

  • Do Managers in Python Multiprocessing module lock the shared data?

    - by AnonProcess
    This Question has been asked before: http://stackoverflow.com/questions/2936626/how-to-share-a-dictionary-between-multiple-processes-in-python-without-locking However I have several doubts regarding the program given in the answer: The issue is that the following step isn't atomic d['blah'] += 1 Even with locking the answer provided in that question would lead to random results. Since Process 1 read value of d['blah'] saves it on the stack increments it and again writes it. In Between a Process 2 can read the d['blah'] as well. Locking means that while d['blah'] is being written or read no other process can access it. Can someone clarify my doubts?

    Read the article

  • Even lighter than SQLite

    - by Richard Fabian
    I've been looking for a C++ SQL library implementation that is simple to hook in like SQLite, but faster and smaller. My projects are in games development and there's definitely a cutoff point between needing to pass the ACID test and wanting some extreme performance. I'm willing to move away from SQL string style queries, allowing it to be code driven, but I haven't found anything out there that provides SQL like flexibility while also preferring performance over the ACID test. I don't want to go reinventing the wheel, and the idea of implementing an SQL library on my own is quite daunting, even if it's only going to be simple subset of all the calls you could make. I need the basic commands (SELECT, MODIFY, DELETE, INSERT, with JOIN, and WHERE), not data operations (like sorting, min, max, count) and don't need the database to be atomic, or even enforce consistency (I can use a real SQL service while I'm testing and debugging).

    Read the article

  • Faking a Single Address Space

    - by dsimcha
    I have a large scientific computing task that parallelizes very well with SMP, but at too fine grained a level to be easily parallelized via explicit message passing. I'd like to parallelize it across address spaces and physical machines. Is it feasible to create a scheduler that would parallelize already multithreaded code across multiple physical computers under the following conditions: The code is already multithreaded and can scale pretty well on SMP configurations. The fact that not all of the threads are running in the same address space or on the same physical machine must be transparent to the program, even if this comes at a significant performance penalty in some use cases. You may assume that all of the physical machines involved are running operating systems and CPU architectures that are binary compatible. Things like locks and atomic operations may be slow (having network latency to deal with and all) but must "just work".

    Read the article

  • Express XPath as an expression tree

    - by 47d_
    If I have an XPath query like NodeA/NodeB[@WIDTH and not(@WIDTH="20")] | NodeC[@WIDTH and not(@WIDTH="20")]/NodeD Is there any API available to visualize this XPath query as a stack of atomic expressions, something like (following is generic) Get results of NodeA, call it "first set" Get results of NodeB from "first set" Filter where [@WIDTH and not(@WIDTH="20")] Filter NodeD, call this "node d for B" Get results of NodeC from "first set" Filter where [@WIDTH and not(@WIDTH="20")] Filter NodeD, call this "node d for C" Combine "node d for B" and "node d for C" I am trying to see if we can convert the XPath expression into custom expression which is close to english and vice versa. If no API is available, what would be the best approach? Thanks in advance.

    Read the article

  • Is my Perl script grabbing environment variabless from "someplace else"?

    - by Michael Wilson
    On a Solaris box in a "mysterious production system" I'm running a Perl script that references an environment variable. No big deal. The contents of that variable from the shell both pre- and post-execution are what I expect. However, when reported by the script, it appears as though it's running in some other sub-shell which is clobbering my vars with different values for the duration of the script. Unfortunately I really can't paste the code. I'm trying to get an atomic case, but I'm at my wit's end here.

    Read the article

  • MySQL transaction conundrum

    - by David Faitelson
    I need to perform several inserts in a single atomic transaction. For example: start transaction; insert ... insert ... commit; However when MySQL encounters an error it aborts only the particular statement that caused the error. For example, if there is an error in the second insert statement the commit will still take place and the first insert statement will be recorded. Thus, when errors occur a MySQL transaction is not really a transaction. To overcome this problem I have used an error exit handler where I rollback the transaction. Now the transaction is silently aborted but I don't know what was the problem. So here is the conundrum for you: How can I both make MySQL abort a transaction when it encounters an error, and pass the error code on to the caller?

    Read the article

  • db2 stored procedure. locking / releasing table

    I use a stored procedure to read/update/return certain fields in a journaled as400 table. I want to lock the table first and then release it after the record is updated. I tried tons of stuff, but releasing table is a problem. SP defines and opens cursor, selects record into variables and updates the record. I tried 'begin atomic', then lock table in exclusive mode and then when it's over, it doesn't release. Is there any statement i missing or do i need to compile it with certain parameters? I use a simple create procedure statement in AS400 navigator's sql panel to compile it. Will very appreciate some help with example. Thanks.

    Read the article

  • Is a Critical Section around an integer getter and setter redundant?

    - by Tim Gradwell
    Do critical sections inside trivial int accessors actually do anything useful? int GetFoo() { CriticalSection(crit_id); return foo; } void SetFoo(int value) { CriticalSection(crit_id); foo = value; } Is it possible for two threads to be attempting to read and write foo simultaneously? I'd have thought 'no' unless integers are written byte-at-a-time, in which case I can see the use. But I'd have though modern cpus would read/write integers in a single atomic action...

    Read the article

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